Tax-loss harvesting and the wash-sale rule, explained with one trade
Sell a fund at a $4,000 loss, buy a similar one, and the loss offsets gains or up to $3,000 of income. Buy the same one back within 30 days and the loss is disallowed. The rule is the whole strategy.
A loss on an investment is real when the investment is sold. Until then it is a number on a screen. The tax code lets a realised loss cancel realised gains, and up to $3,000 a year of ordinary income beyond that, with any remainder carried forward indefinitely. Tax-loss harvesting is the practice of realising losses deliberately to use that rule — while staying invested.
One trade
An investor holds $20,000 of a broad U.S. stock index fund that has fallen to $16,000. They also realised a $4,000 gain earlier in the year on something else. They sell the index fund, and on the same day buy $16,000 of a different broad U.S. index fund from another provider.
Without the sale, the $4,000 gain is taxed at the 15% long-term rate: $600. With it, net gains are zero. The investor still holds $16,000 of U.S. stocks. If there had been no gain to offset, $3,000 of the loss would have reduced ordinary income — worth $660 at the 22% bracket — and $1,000 would carry to 2027.
The wash-sale rule
A loss is disallowed if the same or a substantially identical security is bought within 30 days before or after the sale — a 61-day window centred on the sale date. The disallowed loss is not lost; it is added to the basis of the replacement shares, and comes back when those are sold. But the deduction this year is gone.
- Both directions count. Buying on day −20 and selling on day 0 is a wash sale as much as selling on day 0 and buying on day +20.
- Every account counts. A purchase in an IRA, a spouse's account or a 401(k) — including an automatic dividend reinvestment or a payroll contribution buying the same fund — triggers the rule. The IRA case is worse: the loss is disallowed and never added to any basis.
- Substantially identical is not defined by statute. Two share classes of the same fund are. Two index funds tracking the same index from different providers are widely treated as not, though the IRS has never ruled on it. A U.S. large-cap fund and a total-market fund are clearly not.
| Action within 30 days either side | Wash sale? |
|---|---|
| Buy the same fund back | Yes |
| Buy the same fund in an IRA | Yes — and the loss is permanently lost |
| Dividend reinvestment buys 3 more shares | Yes, for the shares matched to those 3 |
| Buy a different fund tracking the same index | Widely treated as no; not ruled on |
| Buy a fund tracking a different index | No |
| Wait 31 days, then buy the same fund back | No |
What it is worth, honestly
The replacement fund is bought at $16,000. When it is eventually sold, the gain is measured from $16,000, not $20,000 — so the $4,000 that was deducted now is taxed later. The benefit is the time value of the deferral, the chance that the later sale falls in a 0% year, and the $3,000 of ordinary income offset, which converts a capital loss into an ordinary deduction at a higher rate. Real, and smaller than the marketing.
Sources
- Publication 550, Investment Income and ExpensesInternal Revenue Service · checked Sep 24, 2026
- Topic no. 409, Capital gains and lossesInternal Revenue Service · checked Sep 24, 2026