What Is the Wash Sale Rule? Tax Traps to Avoid
The wash sale rule blocks tax deductions if you rebuy the same stock within 30 days. Learn how it works, common mistakes, and how to stay compliant.
The wash sale rule is an IRS regulation that disallows a tax deduction for a loss on a security if you purchase a "substantially identical" security within 30 days before or after the sale. The rule prevents investors from claiming a tax loss while effectively maintaining their position — selling for the tax benefit and immediately buying back the same stock. Understanding the wash sale rule is essential for anyone practicing tax-loss harvesting.
How the Rule Works
You sell 100 shares of Stock A at a $5,000 loss on December 10. If you buy 100 shares of Stock A (or a substantially identical security) between November 10 (30 days before) and January 9 (30 days after), the $5,000 loss is disallowed for tax purposes. You can't deduct it against gains or income that year.
The disallowed loss isn't lost permanently — it's added to the cost basis of the replacement shares. If you bought the replacement shares at $40, your adjusted cost basis becomes $90 ($40 purchase price + $50 per-share disallowed loss). This higher basis reduces your gain (or increases your loss) when you eventually sell the replacement shares. The tax benefit is deferred, not eliminated — but the timing can cost you years of tax savings.
What Counts as "Substantially Identical"
The IRS has never precisely defined "substantially identical," but clear guidelines exist. Buying the exact same stock is obviously a wash sale. Buying a call option on the same stock is a wash sale. Buying a convertible bond that converts into the stock is likely a wash sale.
Buying a different stock in the same industry is not a wash sale — selling Coca-Cola and buying PepsiCo is permitted. Buying a broad ETF that contains the sold stock is generally not a wash sale — selling Apple and buying a technology ETF is typically fine, even though Apple is a holding in the ETF. The key question is whether the replacement is so similar that it provides essentially the same economic exposure.
Common Wash Sale Mistakes
Automatic reinvestment in a dividend reinvestment plan (DRIP) can trigger a wash sale. If you sell shares at a loss but the DRIP automatically purchases new shares within 30 days using dividend payments, the loss may be disallowed. Disable DRIP before harvesting losses.
Cross-account purchases also trigger the rule. If you sell in your taxable account and buy the same stock in your IRA within 30 days, the wash sale applies — and the disallowed loss cannot be added to the IRA's cost basis, meaning the tax benefit is permanently lost (unlike the temporary deferral when both trades occur in taxable accounts).
Spouses can trigger wash sales for each other. If you sell a stock at a loss and your spouse buys the same stock within 30 days (in any account), the wash sale rule applies. Coordinating tax-loss harvesting across spousal accounts is essential.
Quality Investors and the Wash Sale Rule
Quality investors can navigate the wash sale rule effectively by replacing sold positions with comparable-quality alternatives. If you harvest a loss on a wide-moat consumer staples stock, replace it with a different wide-moat consumer staples stock — maintaining your sector exposure and quality profile while complying with the 30-day window. After 31 days, you can buy back the original if you prefer it over the replacement.
Related Posts
See these ideas in action
MoatScope uses the same frameworks you just read about — moat analysis, quality scores, and fair value estimates — across 2,600+ stocks.
Open MoatScope — Free