Wash sale rule
Intro
You sell a losing stock to book the loss for taxes, then buy it right back because you still believe in it. Sensible instinct, disallowed result. The wash sale rule exists precisely to stop you from claiming a loss while keeping essentially the same position.
In plain terms, if you sell a security at a loss and buy the same or a substantially identical security within 30 days before or after the sale, the loss is disallowed (IRC §1091). The window is 61 days wide: 30 days before, the day of, and 30 days after. The disallowed loss is not gone; it is added to the basis of the replacement security, so you get it back later.
Our stance: the wash sale rule is not a reason to avoid tax-loss harvesting. It is a rule to harvest around. Once you understand the 61-day window and what counts as substantially identical, you can capture losses without tripping it.
Body
What triggers a wash sale
Three things have to line up: a sale at a loss, a purchase of the same or substantially identical security, and timing within the 61-day window (§1091). Miss any one and there is no wash sale. Sell at a gain and the rule does not apply at all; it only disallows losses. Buy something genuinely different and the rule does not apply. Wait out the window and the rule does not apply.
The window is the part people underestimate. It runs 30 days before the sale as well as 30 days after, so buying more of a stock and then selling the original lot at a loss shortly after can trigger it just as easily as selling first and buying back. The purchase does not have to come after the sale.
The rule also reaches purchases you might not think of as yours. A buy in your IRA can trigger a wash sale against a loss in your taxable account, and because you cannot add basis to shares inside the IRA in a usable way, that loss can be lost for good. Purchases by a spouse and certain related parties can count too. The window is wider, in practice, than one account.
Substantially identical: the fuzzy line
The rule disallows a loss when you reacquire the same or a substantially identical security. The same stock is obvious. Substantially identical is the judgment call. The IRS and the courts look at whether the securities are so alike that swapping one for the other leaves you in essentially the same economic position.
Different companies in the same industry are generally not substantially identical, even if their prices move together. One company's common stock and a different company's common stock are different securities. This is what makes harvesting workable: you can sell a loser and buy a similar but not identical holding, keeping your market exposure while booking the loss.
Index funds are the gray zone worth care. Two funds tracking the very same index may be substantially identical; two funds tracking different indexes in the same asset class generally are not, even if they overlap heavily. There is no bright-line rule, so the conservative path is to move to a fund tracking a clearly different index rather than a near-clone of the one you sold.
The loss is deferred, not destroyed
When the rule disallows a loss, it does not vanish. The disallowed amount is added to the tax basis of the replacement shares, and the holding period of the old shares tacks on. So you recover the loss when you eventually sell the replacement position; you have just postponed it, not lost it.
This matters for how much the rule actually costs you. In a plain taxable account, a wash sale usually means timing, not forfeiture: the benefit shifts to a later sale. The real damage happens when the replacement is bought somewhere the basis adjustment cannot help you, like an IRA, where the disallowed loss can disappear for good.
Understanding the basis mechanic also keeps you from double-counting. People sometimes think a wash sale erases the loss and then forget that their replacement shares now carry a higher basis. The loss is sitting in that basis, waiting. Track it, and you will claim it at the right time.
Harvesting without tripping the rule
The clean way to harvest is to avoid the 61-day window on a substantially identical security. Two standard approaches work. Sell the loser and simply wait more than 30 days before buying it back, accepting the market risk in between. Or sell the loser and immediately buy a similar but not substantially identical holding, keeping your exposure while the loss is locked in.
The second approach is usually better for staying invested, and it pairs naturally with how capital gains and losses net against each other. A harvested loss offsets gains and up to $3,000 of ordinary income a year, with the rest carrying forward, so the point of harvesting is to generate usable losses without going to cash.
A few operational habits keep you out of trouble. Watch automatic dividend reinvestment, which can quietly buy replacement shares inside the window. Coordinate across your accounts and your spouse's. And be careful at year end, when the 30-day tail can push the clean date into January. The rule is mechanical, so the defense is simply to respect the calendar.
Summary
The wash sale rule disallows a loss when you buy the same or a substantially identical security within 30 days before or after selling at a loss, a 61-day window (IRC §1091). The disallowed loss is not destroyed; it is added to the basis of the replacement shares and recovered on a later sale, except where the replacement sits somewhere like an IRA that cannot use the basis. Different companies are generally not substantially identical, and funds on different indexes generally are not, which is what makes tax-loss harvesting workable. Harvest by waiting out the window or buying a similar but not identical holding, and watch reinvested dividends, related accounts, and year-end timing.
Sources
Related articles
More in Federal income tax - core concepts
- Gross incomewhat counts as income under §61
- Adjusted gross income (AGI)the above-the-line subtotal that drives everything
- Taxable incomeincome after deductions
Related prompts & skills
Put this to work
5 free prompts and skills from the library, matched to this article.