Educational information, not individual financial advice.
Key Takeaways
The wash sale rule is designed to prevent investors from generating artificial losses by selling and immediately buying back the same security. It can unintentionally disallow legitimate harvested losses if you're not careful.
If you sell a security at a loss, and within 30 days before or after that sale you buy a "substantially identical" security, the loss is disallowed for tax purposes. Instead, the disallowed amount is added to the basis of the replacement shares, preserving the loss to be realized when those shares are eventually sold.
The window is 61 days total: 30 days before the sale, the day of sale, and 30 days after.
January 10: Buy 100 shares of XYZ at $50 = $5,000. February 15: XYZ has dropped to $40. Sell 100 shares for $4,000, realizing a $1,000 loss. March 5: Buy 100 shares of XYZ at $38 = $3,800.
The February 15 loss is disallowed because the March 5 purchase is within 30 days. The $1,000 loss is added to the March 5 basis, so your basis in the new shares is $3,800 + $1,000 = $4,800.
If you hold the new shares until their sale generates a clean event (no other wash sale triggers), you eventually realize the loss when you sell at $4,800 or below.
The rule applies across all accounts you control:
The IRA coverage is especially dangerous. Selling a mutual fund at a loss in your taxable account and buying the same fund in your IRA within 30 days permanently vaporizes that loss — because basis adjustments in tax-advantaged accounts don't produce future tax benefits.
The IRS has not published comprehensive guidance. Generally understood:
Clearly substantially identical:
Generally considered not substantially identical:
Gray area:
Conservative practice: choose replacement securities that track clearly different indexes.
The two most common accidents:
Automatic dividend reinvestment. A stock you've owned for years pays a dividend that's automatically reinvested. You sell the position at a loss a week later. The dividend reinvestment counts as a purchase, triggering the wash sale on that portion.
Regular contributions to a similar fund in your 401(k). You sell a taxable fund at a loss. You keep contributing to a similar fund in your 401(k) via payroll. Any within-30-days contribution triggers the wash sale against the taxable loss.
Solutions: turn off dividend reinvestment before harvesting, and temporarily redirect 401(k) contributions to a different fund.
For normal investors, wash sales are an administrative inconvenience, not a tax catastrophe — the loss just shifts to later basis. The big exception is wash sales involving tax-advantaged accounts, where the loss is genuinely lost.
Horizons flags potential wash sale situations in the Tax Harvesting view based on recent transactions and pending contributions to similar funds. The engine doesn't execute trades, but it can warn you when a planned harvesting sale would conflict with automatic 401(k) or IRA contributions nearby in time.
You harvest a $5,000 loss on VTI (total market ETF) on Jan 10. On Jan 25, your 401(k) makes its automatic contribution to a similar total-market fund. What happens?
Try this next
Tax-Loss Harvesting
More related reading