Sell a stock at a loss, buy it back the next morning, claim the deduction — the tax code saw that coming about a century ago. Here is how the 30-day rule works and how investors legally stay on the right side of it.
Answer first: under the U.S. wash sale rule (Internal Revenue Code §1091), if you sell a security at a loss and buy the same or a substantially identical security within 30 days before or after the sale, the loss is disallowed for that tax year. Counting the sale date itself, the danger zone spans a 61-day window: 30 days back, the day of sale, 30 days forward. The rule exists to stop investors from manufacturing tax deductions while never really giving up the position.
A wash sale does not vaporize your loss — it defers it. The disallowed amount is added to the cost basis of the replacement shares, and the old holding period tacks on too. When you eventually sell the replacement (without triggering another wash sale), the postponed loss finally counts. The painful exception: rebuying inside an IRA. The IRS has ruled that a wash sale caused by an IRA repurchase permanently destroys the loss, because there is no taxable basis in the IRA to adjust.
Example: buy at $50, sell at $40 for a $10 loss, rebuy at $42 within 30 days. The $10 loss is disallowed now, and your new shares’ basis becomes $42 + $10 = $52. Sell them later at $60 and you owe tax on $8, not $18 — the loss resurfaced.
Deliberate rebuys are the obvious case, but most wash sales are accidental:
Brokers must flag wash sales of identical securities within one account on your 1099-B, but you are responsible for cross-account and cross-spouse violations they cannot see.
Anyone practicing tax-loss harvesting plans replacements before selling: swap into a comparable-but-not-identical fund for 31 days, pause DRIP on the harvested position, and check recent automatic purchases before pulling the trigger. Waiting out the window in cash also works — at the cost of 31 days of market exposure, which in a sharp rebound can dwarf the tax benefit.
Not tax advice: this page summarizes long-standing U.S. federal rules in plain English. Details (including how the rule applies to newer asset classes) evolve — verify current treatment at irs.gov or with a professional. Educational content only.
Keep going: tax-loss harvesting explained, capital gains taxes, and the capital gains tax calculator.
Last updated July 2, 2026 · Written by Mustafa Bilgic. Educational only — not financial advice.
If you sell a security at a loss and buy the same or a substantially identical one within 30 days before or after the sale, you cannot claim the loss that year. It gets added to the new shares' cost basis instead.
No — it is perfectly legal to trigger one. The only consequence is that the tax loss is deferred rather than deductible immediately.
Usually not. The disallowed loss is added to the replacement shares' basis, so it reduces your taxable gain when you eventually sell them. The exception is rebuying in an IRA, which destroys the loss permanently.
Yes. It applies across all your accounts, including IRAs and your spouse's accounts. Brokers only auto-report wash sales within a single account, but the rule still binds you across all of them.
Wait 31 days before rebuying, or immediately buy a similar but not substantially identical investment. Also pause dividend reinvestment and check scheduled purchases within the 61-day window.