What is Wash Sale Rule?
The wash-sale rule blocks you from claiming a loss if you buy the same or a "substantially identical" security within 30 days before or after selling it at a loss.
How it works
The IRS created it to stop people from selling purely for the tax loss and immediately rebuying. When it applies, the disallowed loss isn't gone — it's added to the cost basis of the replacement shares, deferring the benefit rather than erasing it.
A quick example
What people get wrong
The 30-day window runs both directions — before and after the sale — so watch automatic dividend reinvestments and purchases in your IRA, which can quietly trigger a wash sale.