How to use this wash sale calculator
The wash sale rule is the most commonly misapplied provision in investing tax. People know it exists, they know it involves a 30-day window, and they consistently misunderstand both the mechanism and the consequence.
The rule, stated precisely
If you sell a security for a loss, and you or your spouse buy a substantially identical security within 30 days before or after the sale, the loss is disallowed for the current tax year. It is not forfeited — it is added to the cost basis of the replacement shares. You recognise it later, when you eventually sell those replacements without triggering another wash sale.
The window is 61 days in total: 30 days before the sale and 30 days after. That means the purchase date on the replacement matters as much as the sale date.
What the calculator shows
On a 100-share position with a $100 basis sold at $80 after 20 days, the total loss is $2,000. If you bought back 50 replacement shares within the window, half the loss — $1,000 — is disallowed and deferred. The other $1,000 can offset gains this year. The 50 replacement shares get a new basis of $120 per share rather than the original $100, because $1,000 of disallowed loss divided across 50 shares is $20 added to each.
Note that you sold the position at a short-term loss (held 20 days), so it offsets short-term gains at your ordinary rate — 24% rather than the 15% long-term rate. That timing distinction is worth more than most people realise: harvesting a loss only helps if the gain it offsets sits in a bracket higher than the loss would have used.
What is substantially identical
The IRS says "substantially identical" without defining it precisely, and the ambiguity is real. Generally safe: a completely different company, or a broad market index fund. Generally treated as a wash: the same stock, a different share class of the same company, or an option on that stock.
The safest strategy is to change what you own, not when you sell. If you need to exit a losing position, sell it and stay out for 31 days. If you want to keep the exposure, buy something genuinely different.
The IRA trap
Buying the replacement inside an IRA is the worst option. The loss is permanently disallowed rather than deferred, because IRA basis is not tracked for adjustment. You get no offset this year and no adjustment later — the loss simply disappears. This catches people who buy the replacement in a tax-advantaged account to avoid triggering a wash sale on the taxable account.
Is harvesting losses worth the complexity?
Sometimes, and it depends on your bracket. Two things make it not worth doing:
- Your gains are already at 0%. Losses do not offset the 0% long-term capital gains bracket. If you have $50,000 of long-term gains taxed at 0% and you harvest $5,000 of losses, you now pay tax on $45,000 at 0% instead of $50,000 at 0% — no benefit, and you have permanently given up the $5,000 loss.
- You are in a low-income year. The value of a loss is the bracket rate it offsets. A $10,000 loss against zero income is worth nothing this year and might be worth something in ten years.
Harvesting makes clear sense when you have gains in the 15% or 20% bracket, and it makes sense to do it in a year when your income is unusually low. Otherwise, the complexity is not worth it.