The wash sale rule exists to stop one specific trick: selling an investment at a loss purely to claim the tax deduction, then buying it right back so nothing really changed. If you repurchase the same or a "substantially identical" security within a 30-day window, the IRS disallows the loss. It is one of the most misunderstood rules in taxable investing, and tripping it can quietly erase a deduction you were counting on. This is general information, not tax advice.
What changed in 2026
- Crypto remains a gray area. Traditional securities are clearly covered; the rule application to digital assets has been debated, and legislation has repeatedly threatened to close the gap — verify the current treatment before relying on it.
- Broker software flags many wash sales. Brokerages now warn about and adjust obvious wash sales automatically, but they cannot see trades across your other accounts, including a spouse account or an IRA.
- Tax-loss harvesting stayed popular. Automated harvesting inside robo-advisors is common, which makes understanding the rule more relevant, not less.
How the rule works
The window is 61 days wide: 30 days before the sale, the day of the sale, and 30 days after. If you buy a substantially identical security anywhere in that span, the loss is disallowed for now. Crucially, the loss is not gone forever — it is added to the cost basis of the replacement shares, which is where this rule ties directly into cost basis tracking.
What counts as substantially identical
This is the fuzzy part. The same stock is obviously identical. Selling one S&P 500 index fund and buying a different provider S&P 500 fund tracking the same index is risky, and often treated as substantially identical. Swapping into a fund that tracks a different index — a total-market fund for an S&P 500 fund, say — is generally considered safe, though not risk-free.
| Action |
Wash sale risk |
| Rebuy the exact same stock |
High — clearly triggers |
| Same index, different provider |
High — likely identical |
| Different index, similar market |
Lower — generally allowed |
| Buy in your IRA after selling in taxable |
Triggers, and the loss is lost for good |
The IRA trap and other pitfalls
The nastiest version: sell at a loss in a taxable account, then buy the same security in your IRA within the window. This triggers the rule and the disallowed loss cannot be added to the IRA basis, so the deduction vanishes permanently. The rule also reaches across accounts you might not expect, including a spouse account. Automatic dividend reinvestment can trigger it too — a small reinvested purchase during the window can disallow part of a loss.
Harvesting losses safely
Tax-loss harvesting is legitimate and useful; the wash sale rule just sets the boundaries. To stay clear, wait more than 30 days before repurchasing, or move into a genuinely different investment that fills the same role without being substantially identical. Turn off automatic reinvestment on positions you plan to harvest, and check every account, not just the one you traded in.
FAQ
How long do I have to wait to rebuy?
More than 30 days after the sale to be safe, and remember the window also covers the 30 days before. Buying inside either side of that span risks the disallowance.
Is the disallowed loss gone forever?
Usually no — it is added to the basis of the replacement shares, so you recover it when you eventually sell those. The exception is the IRA trap, where it can be lost permanently.
Does the rule apply to crypto?
It has been a gray area, and rules may change. Do not assume crypto is exempt in 2026 without checking current law.
Can I harvest a loss and stay invested?
Yes — buy a similar but not substantially identical investment so you keep market exposure while the window runs. That is the core of safe tax-loss harvesting.
Where to go next
Deepen your taxable-account tax knowledge: understand cost basis, the tax split between qualified and ordinary dividends, and how portfolio rebalancing can create harvesting opportunities.