The Wash Sale Rule
Selling at a loss to reduce a tax bill is one of the few genuinely free moves in a taxable account. The wash sale rule is the constraint that makes it non-trivial: buy the same thing back too soon and the loss does not count this year. Most people who fall foul of it never made a deliberate repurchase at all β a dividend reinvested automatically was enough.
- The window:: 61 days β the 30 days before the sale, the day of the sale, and the 30 days after.
- What triggers it:: Buying the same or a substantially identical security, including through automatic dividend reinvestment.
- Not lost, deferred:: The disallowed loss is added to the replacement shares' basis, so it is recovered when those are eventually sold.
- The IRA exception is worse:: A repurchase inside an IRA disallows the loss permanently β there is no basis to add it to.
Where the AI summary above gets this wrong
"Wait 30 days after selling before you buy the stock back."
That's surface-true. Here's what it misses:
- The window runs both ways β It is 61 days, not 30. A purchase in the 30 days before the sale triggers the rule just as a purchase after does. Someone who buys more of a falling position and then sells the older lot for a loss has created a wash sale without ever repurchasing anything.
- It follows you across accounts β The rule is written about the taxpayer, not the account. A sale in a taxable brokerage account and a purchase in an IRA, a spouse's account, or a second brokerage all count. Brokers report wash sales within one account, so the cross-account ones are yours to track.
- A repurchase inside an IRA destroys the loss outright β Normally a disallowed loss is added to the replacement shares' basis and recovered later. When the replacement is bought inside an IRA there is no basis to adjust, so the loss is gone permanently. This is the one version of the rule with a real cost rather than a delay.
01 What the rule says
The wash sale rule disallows a loss where you sell a security and acquire the same or a substantially identical security within 30 days before or 30 days after the sale. That is a 61-day window centred on the sale date.
The loss is not destroyed in the ordinary case. It is added to the cost basis of the replacement shares, and the holding period carries over, so the benefit arrives when those shares are eventually sold rather than this year.
Acquiring an option or contract to buy the security counts as acquiring it. So does a purchase by your spouse, or by a company you control. The rule is deliberately hard to sidestep by moving the purchase somewhere adjacent.
Source: Publication 550
02 What 'substantially identical' means in practice
The same stock is obviously identical. Two index funds from different providers tracking the same index are, on most readings, not substantially identical β but two share classes of the same fund are, and an ETF and its own mutual fund equivalent are.
The practical approach in tax-loss harvesting is to move to a fund tracking a different index with similar exposure β a total market fund replaced by a large-cap index fund, say β which keeps the portfolio invested without the question arising. The exposure gap over 31 days is usually small relative to the tax saved.
The alternative, sitting in cash for 31 days, is a real risk. A market that rises during the window costs more than the harvest was worth, and that has happened often enough that avoiding it is the main reason to hold a replacement rather than cash.
Shows: the tax the harvested loss would have saved this year, which a wash sale defers into the replacement shares' basis instead. Ignores: that the benefit is deferred rather than lost, the time value of waiting for it, state tax, and the $3,000 annual limit on offsetting ordinary income.
03 The settings that trigger it by accident
Automatic dividend reinvestment is the most common accidental trigger. A fund pays a dividend two weeks after you harvested a loss in it, the reinvestment buys shares, and part of the loss is disallowed. Turning reinvestment off before harvesting is the fix, and it needs doing in every account holding the security.
The second is a workplace plan or an automatic monthly contribution buying the same fund on schedule. The third is a spouse's account, which is invisible from your side of the household and counts anyway.
None of this makes harvesting not worth doing. It makes it worth doing deliberately: check what else buys the security automatically, pause it, harvest, and hold a non-identical replacement until the window closes. The wider asset location layout also matters here, because holding the same fund in both a taxable account and an IRA is what creates the permanent version of the problem.
Source: Publication 550
Almost every wash sale I have seen was created by a setting nobody remembered switching on. Dividend reinvestment is on by default at most brokers, and it does not ask before buying. If you harvest losses at all, the habit worth building is to check the reinvestment setting in every account that holds the fund before you sell, not after. It takes two minutes and it is the difference between a loss you can use this year and one you get back in a decade.
FAQ
How long do I have to wait to buy back a stock I sold at a loss?
31 days after the sale. The rule covers 30 days before and 30 days after, so a purchase anywhere in that 61-day window disallows the loss for that year.
Does a wash sale in my IRA matter?
Yes, and more than elsewhere. If you sell at a loss in a taxable account and buy the same security in your IRA within the window, the loss is disallowed permanently, because there is no basis in the IRA to add it to.
Are two different index funds substantially identical?
Funds from different providers tracking different indexes are generally not, which is why harvesting usually swaps into a similar but not identical fund. Two share classes of the same fund are identical.
Sources
Regulator references
- Publication 550 Β· Internal Revenue Service Β· 2026The wash sale rule, the 61-day window, and how the disallowed loss is handled.Last verified: 2026-09-07
- Topic 409: capital gains and losses Β· Internal Revenue Service Β· 2026How capital losses offset gains and the annual limit against ordinary income.Last verified: 2026-09-07
Calculator unit tests Β· the assertions this page's worked example is checked against, and their last result
Changelog
- 2026-09-07 β initial publish (new format)
Run this rule against your situation
See what this rule does to your own projection β month by month, to age 90.
Join the Waitlist