Case study
When switching pays you: the math of tax-loss harvesting
Most of this site is about what switching costs you. This one is about when switching pays you. If a fund in your taxable account is worth less than you paid for it, selling it can put money back in your pocket.
It's called tax-loss harvesting, and it's one of the few free lunches in investing. Well, mostly free. There's a catch, and it's worth seeing it in actual numbers.
The setup
- A fund worth $100,000 that you bought for $120,000, a $20,000 long-term loss
- You sell it and immediately buy a similar but not identical fund, so you stay invested
- Both funds are expected to earn the same 7% a year
- You already realized $5,000 of capital gains elsewhere this year
- Your capital gains rate is 15% and your ordinary income rate is 24%
What the loss is worth
A realized capital loss gets used in a specific order:
- It first cancels out other capital gains you realized this year. Here, $5,000 of the loss wipes out your $5,000 gain, saving $750 at 15%.
- Up to $3,000 a year of what's left can be deducted against ordinary income, like your salary. At 24%, that saves $720 a year.
- Anything beyond that carries forward to future years, indefinitely.
So the remaining $15,000 gets used at $3,000 a year for five years. Total tax saved: $4,350, spread over five years, and every dollar of it can be invested.
The catch
When you sell at $100,000 and buy the new fund, your cost basis resets to $100,000. Before, it was $120,000. That lower basis means a bigger taxable gain when you eventually sell the new fund.
In this example, after 20 years the switch path pays $44,662 of tax at the end, versus $40,045 on the keep path. So part of what you saved comes back later.
Why it's still a good deal:
- Timing. You save tax now and repay some of it decades later. The savings compound in the meantime.
- Rate difference. Most of the savings come at your 24% ordinary rate. The payback happens at the 15% capital gains rate. You deduct at a high rate and repay at a lower one.
| Years held | Harvesting leaves you ahead by |
|---|---|
| 1 | +$1,573 |
| 5 | +$2,312 |
| 10 | +$4,188 |
| 20 | +$10,509 |
The 20-year hurdle here is 6.83%, below the 7% the old fund earns. The tax savings are worth enough that the replacement fund could earn about 0.17 points a year less and you'd still break even.
What changes the value
- Other gains this year. Using the loss against capital gains saves tax at 15%. Using it against ordinary income saves 24%. With no other gains, the 20-year advantage rises slightly to about $10,850. With $20,000 of other gains, it drops to about $7,300.
- Holding for heirs. If the new fund passes to heirs with a step-up in basis, the lower basis never gets taxed at all. The 20-year advantage grows to about $15,100.
The wash-sale rule
If you buy the same or a "substantially identical" investment within 30 days before or after selling at a loss, the IRS disallows the loss. That includes purchases in your IRA and automatic dividend reinvestments. This is why harvesters swap into a similar fund, such as a different index covering a similar market, rather than buying back the same one. The IRS hasn't precisely defined "substantially identical," so this is a good question for a tax professional.
Try it with your numbers
The free calculator handles the basic case: it applies a realized loss against your final gain. The yearly deductions and offsets shown here come from the full engine, which is launching soon.
Run this example in the calculator
Figures assume flat 15% capital gains and 24% ordinary rates, the $3,000 annual limit, tax savings reinvested in the same fund, identical returns for both funds, and both paths fully sold at the end of the period except in the step-up case. These are illustrations of the arithmetic, not tax advice or a recommendation. Check your own situation with a tax professional.