Tax-Loss Harvesting and the IRA Wash-Sale Trap
Tax-loss harvesting is the practice of selling a losing position to generate a deductible capital loss, then buying a similar but not identical replacement to stay in the market. It works only in taxable accounts — and it interacts with retirement accounts in two specific, often-missed ways.
The mechanics
When you sell a security at a loss, the loss offsets capital gains dollar-for-dollar under IRC §1211. If your losses exceed your gains for the year, up to $3,000 of net loss can offset ordinary income; the remainder carries forward indefinitely. There is no "use it or lose it" — unused losses follow you until death, at which point they vanish.
The wash-sale rule
IRC §1091 disallows the loss if you buy a "substantially identical" security within 30 days before or after the sale, in any of your accounts. The disallowed loss is added to the basis of the replacement security, so it is deferred, not lost — unless the replacement is held inside an IRA.
The IRA wash-sale trap
Revenue Ruling 2008-5 holds that selling a security at a loss in a taxable account and buying the same security in your IRA within the 61-day window triggers the wash-sale rule and the disallowed loss is permanently lost — it cannot be added to the IRA's basis because IRAs do not track per-share basis. This is the only place in the wash-sale regime where the loss disappears for good.
The same trap applies to a Roth IRA, a spousal IRA, and (per IRS informal positions) to a 401(k) and other employer plans. The safest rule: do not buy the harvested security in any of your retirement accounts within 30 days.
Spousal accounts
The wash-sale rule looks at "you or your spouse." Selling a position in your taxable account and having your spouse buy the same fund in hers triggers a wash sale. This includes purchases inside her IRA, where the IRA trap above also applies.
Worked example
You bought the Vanguard Total Stock Market ETF (VTI) in your taxable account at $250/share. The market drops, and VTI is now $220. You sell 1,000 shares, realizing a $30,000 capital loss. You immediately reinvest in the Schwab U.S. Broad Market ETF (SCHB) — a different fund tracking a different index, not "substantially identical" under §1091. Your portfolio's market exposure is unchanged. The $30,000 loss is locked in: $3,000 offsets ordinary income this year, $27,000 carries forward.
If you had instead bought VTI inside your IRA within 30 days, Rev. Rul. 2008-5 would disallow the $30,000 loss and you would have no basis credit to recover it.
"Substantially identical" — the gray zone
Two ETFs tracking the same index from different issuers are generally treated as not substantially identical (VTI vs. SCHB, both broad-U.S. market). Two share classes of the same mutual fund are substantially identical. Bonds with the same issuer but different CUSIPs are generally not substantially identical unless the terms are essentially the same. The IRS has not issued comprehensive guidance, so the conservative path is "different issuer, different index."
Common mistakes
- Reinvesting dividends during the wash-sale window. Dividend reinvestment is a purchase. A small DRIP buy in the 30-day window can trigger a partial wash sale.
- Forgetting the 30-day window before the sale. The rule looks 30 days backward as well as forward.
- Harvesting in a retirement account. A loss inside an IRA is invisible to the tax code — no deduction, no carry-forward. There is nothing to harvest.
- Ignoring the $3,000 cap when you have no gains. Large harvested losses without offsetting gains are deducted at only $3,000 per year against ordinary income. Pair with realized gains to use the full amount.
Sources
- Internal Revenue Code §1091, wash sales of stock or securities (Cornell LII): law.cornell.edu/uscode/text/26/1091
- Internal Revenue Code §1211, limitation on capital losses: law.cornell.edu/uscode/text/26/1211
- Revenue Ruling 2008-5, wash-sale rule applies to purchases in an IRA: irs.gov/pub/irs-drop/rr-08-05.pdf
- IRS Publication 550, Investment Income and Expenses: irs.gov/forms-pubs/about-publication-550
- IRS Topic No. 409, capital gains and losses: irs.gov/taxtopics/tc409
Tax-loss harvesting lives in your taxable account, not in the RetirementCheck101 worksheet — but the after-tax growth assumptions in our projections account for it. Explore the free educational tool.