Glossary
The wash-sale rule is the IRS provision that cancels a capital loss when you rebuy the same or a substantially identical investment within 30 days before or after selling it. The loss is not deleted; it folds into the cost basis of the replacement shares.
The wash-sale rule, Section 1091 of the tax code, disallows a capital loss when the seller acquires the same or a substantially identical security within a 61-day window: 30 days before the sale, the day of the sale, and 30 days after. The window runs in both directions, so a purchase made three weeks ago counts against a sale made today. The disallowed loss does not vanish; it folds into the cost basis of the replacement shares, and the holding period extends by the same amount. The rule exists to stop taxpayers from selling at a loss, keeping the economic position, and deducting the loss anyway. The day-of-sale rebuy is the classic accidental wash.
Two boundaries matter in practice. The rule has no force inside a 401(k) or IRA for harvesting purposes, because gains and losses in those accounts have no tax consequence to begin with. Per IRS Revenue Ruling 2008-5, buying the replacement security in a spouse's account or in your own IRA counts as a wash. And the IRS has never published a bright line for what counts as substantially identical: the same CUSIP is always a wash, funds tracking different indexes are the standard accepted swap, and brokerages flag the same-CUSIP cases automatically on Form 1099-B while leaving the multi-account and option cases to the taxpayer to track. The automation catches the identical CUSIP; the judgment calls are the taxpayer's.
The mechanics run through Section 1091: sell 100 shares at a $1,000 loss, rebuy the same shares the next morning, and the loss is disallowed on that year's return. The $1,000 folds into the cost basis of the replacement shares, which now cost what the market charged plus the loss you were not allowed. When those replacement shares eventually sell outside the window, the deferred loss is finally realized, and the arithmetic nets out to the same economics with the timing pushed back. The rule is a timing provision more than a ban, which is why harvesting remains fully legal around it.
The window is the trap most people miss. It covers the 30 days before the sale as well as the 30 after, so a dip-buy made three weeks ago is already a wash for a sale executed today. Options count as acquisitions: buy a call on the stock you sold at a loss and the wash-sale rule triggers as if you had bought the shares. Revenue Ruling 2008-5 extends the same treatment to a spouse's account and to your own IRA, which is the version that permanently deletes losses harvested inside a retirement wrapper.
What counts as substantially identical is decided in practice, not by statute. The same CUSIP is always a wash, and the same fund's share classes are treated the same way by brokerages that flag them automatically. Two index funds tracking different indexes, an S&P 500 fund and a total-market fund for example, are the standard accepted swap, and the IRS has never challenged the practice broadly. The paperwork lands on Form 1099-B and Form 8949 each January, where brokerages prefill the wash-sale adjustments they caught and leave the ones they could not see.
The rule shapes the loss-harvesting playbook rather than banning it, and the shape is simple: stay invested through the window and the deduction stays bankable. A taxable brokerage compounds under an annual tax drag that a 401(k) never pays, and harvested losses are the one lever that pulls the bill down without changing the portfolio. The 30-day window is the only rule that bites, and it is a routing problem, not a stop sign.
I watched a colleague named Brent (yes, that Brent) harvest a $12,000 loss in a correction, then rebuy the identical fund nine days later because the market was bouncing. The wash-sale rule cancelled the loss, the following January's Form 1099-B printed the adjustment, and the refund he had already mentally spent did not exist. He kept the position and lost the deduction in the same trade, which is the rule working exactly as designed.
The highest-leverage thing most Americans can do is treat the window as a routing problem: swap into a fund that tracks a different index, stay invested, and let the loss stay bankable. Estimate the deduction with the tax-loss harvesting calculator and net the year's gains and losses with the portfolio tax calculator. The trough is survivable; the paperwork error at the trough rarely is.
An investor sells a fund at a $3,000 loss and rebuys the identical fund the same afternoon, in the 22% bracket. The wash-sale rule disallows the loss, the $3,000 folds into the replacement's basis, and the $660 deduction the sale was meant to produce waits until the replacement shares sell outside the window. The portfolio never changed; the tax return did. The market exposure was identical on both sides of the paperwork, which is exactly the outcome Section 1091 was written to price.
A taxpayer sells at a $5,000 loss and buys the replacement fund inside a spouse's IRA, assuming separate accounts mean separate rules. Revenue Ruling 2008-5 says otherwise: the IRS treats the couple as one taxpayer for the wash-sale window, the loss is disallowed, and inside the IRA it can never be realized again. The deduction is deleted permanently rather than deferred. The account boundary that felt like a loophole is the one the ruling was written to close.
A trader sells a stock at a $4,000 loss, then buys a $300 call on the same stock twelve days later, expecting to wait out the rebuy in options instead of shares. An option to acquire the security counts as acquiring it, so the wash-sale rule triggers on the call purchase. The $4,000 loss is disallowed and folds into basis. The premium was small; the cancelled deduction at the 24% bracket was $960, and the option expired worthless three weeks after that.
Mistake: Rebuying the identical fund inside the 30-day window.
Why it bites you: The loss is cancelled and folds into basis, and Brent's $12,000 harvest became a basis adjustment instead of a deduction. The January 1099-B printed the news.
Mistake: Assuming the rule only looks backward at purchases made after the sale.
Why it bites you: The window covers the 30 days before the sale too, 61 days total. A dip-buy made three weeks ago is already a wash for today's sale.
Mistake: Swapping through an IRA or a spouse's account to time the rebuy.
Why it bites you: Revenue Ruling 2008-5 counts both, and a wash inside an IRA is deleted permanently because losses there can never be realized.
Mistake: Assuming every similar fund is substantially identical.
Why it bites you: The IRS never published a bright line, and the same-CUSIP cases are certain while the edge cases are not. The different-index swap is the conservative read.
I spent an evening inside Section 1091 and the IRS wash-sale rulings, Revenue Ruling 2008-5 included, so you do not have to, and the finding is that the rule is narrower than its reputation. It cancels nothing permanently outside a retirement wrapper, it moves the loss into basis, and it leaves the harvesting playbook fully intact for anyone willing to own a different fund for a month. I ran Brent's trade through the 61-day window out of curiosity, and the answer matched the regulation's, which is the rare case where the tax code is more forgiving than the investor's panic.
Brent rebought the identical fund because a different one felt like cheating. The cheating was the rebuy, and the tax code said so in writing. Swap, stay invested, and let the calendar do the waiting; the loss keeps.
The window runs 30 days before the sale through 30 days after, 61 days total. Rebuying on day 31 is outside the window and the loss survives intact.
Buying the replacement security in your own IRA counts as a wash under Revenue Ruling 2008-5, and the loss is disallowed permanently. Harvesting losses only works in taxable brokerage accounts, where the deduction has a tax return to land on.
It is not deleted: the disallowed amount folds into the cost basis of the replacement shares. The loss is finally realized when the replacement shares are sold outside the window.
Common practice treats funds tracking different indexes as not substantially identical, which is the standard harvesting swap the industry has used for decades. The IRS has never published a bright line, so the conservative read is to swap across different index methodologies, not just different brands.
Yes to both: buying a call on a stock you sold at a loss counts as acquiring it, and Revenue Ruling 2008-5 extends the rule to purchases in a spouse's account. The 61-day window is the same in both cases.
Disclaimer: This information is general in nature and does not constitute financial or legal advice. Always consult a qualified professional for your specific situation.

Financial Chaos Analyst
Ivy Sinclair-Wren is a Financial Chaos Analyst covering investing, AI, wealth psychology, and the emotional consequences of opening finance apps during market crashes. Based in Melbourne, she specializes in demystifying the US tax code and helping users navigate the intersection of spreadsheet logic and human irrationality.