The wash-sale rule is a tripwire that catches investors trying to claim a tax loss while staying in the same position. If you sell a security at a loss and buy it back too soon, the IRS disallows the deduction for that year. Knowing the exact window and what counts as a repurchase keeps your harvested losses valid.
What triggers a wash sale
A wash sale occurs when you sell a stock or security at a loss and buy the same or a substantially identical security within 30 days before or after the sale. That creates a 61-day window centered on the sale date. The rule also applies if your spouse or a company you control makes the purchase, and even if the repurchase happens in a different account. The loss is not lost forever, but it cannot be claimed on that year's return.
What happens to the disallowed loss
Rather than disappearing, the disallowed loss is added to the cost basis of the replacement shares. Your holding period from the original shares also carries over to the new ones. This means you eventually get the tax benefit when you sell the replacement, just later than you hoped. The rule defers the deduction, it does not delete it.
What counts as substantially identical
The same stock or a fund tracking the same index generally counts as substantially identical, while a fund tracking a different index usually does not. Options and contracts to buy the same security can also trigger the rule. The IRS has never published a precise line, so conservative investors leave a clear gap between what they sell and what they buy. Choosing a genuinely different replacement is the safest way to stay clear.
How to avoid it
The simplest fixes are to wait at least 31 days before repurchasing the original security, or to buy a similar-but-different investment right away. Investors harvesting losses often swap between two comparable index funds from different providers. Be careful about automatic dividend reinvestment and purchases in an IRA, both of which can quietly trigger the rule. A little planning keeps the loss deductible.
You sell a stock on June 1 for a $2,000 loss, then rebuy the same stock on June 20. Because that is within 30 days, the wash-sale rule disallows the $2,000 loss for the year and instead adds it to the basis of your new shares, delaying the benefit until you sell them.
Key takeaways
- The rule disallows a loss if you rebuy the same or substantially identical security within 30 days before or after the sale.
- The full danger zone is a 61-day window centered on the sale date.
- A disallowed loss is added to the replacement shares' basis, deferring rather than erasing it.
- Purchases by a spouse, in another account, or via reinvested dividends can all trigger it.
- Waiting 31 days or buying a different-enough asset keeps the loss valid.
Common mistakes
- Rebuying the identical stock or fund inside the 30-day window.
- Forgetting that automatic dividend reinvestment counts as a repurchase.
- Assuming a wash sale in a taxable account is fixed by buying the security in an IRA — it is not.
FAQ
Does the wash-sale rule apply to gains?
No, it only applies to losses; you can sell and rebuy a winning position freely because there is no loss to disallow.
Does it apply to cryptocurrency?
As of 2025 the wash-sale rule generally does not apply to crypto because the IRS treats it as property rather than a security, though proposals to change this have been discussed.