The wash sale rule
You can't deduct a loss on stock or securities if you buy substantially identical stock or securities (or a contract or option to buy them) within 30 days before or after the sale. That's a 61-day window including the sale date. The rule is in section 1091 of the tax code.
Disallowed loss = loss per share × replacement shares matched
New basis = cost of replacement shares + disallowed loss added to them
Fewer shares bought than sold: only the loss on that many shares is disallowed. The rest is deductible. More bought than sold: the shares sold are matched to the replacement shares in the order they were bought, earliest first, and later purchases keep their own basis. The disallowed loss isn't lost forever. It's added to the basis of the replacement shares, and their holding period includes the time you held the shares you sold.
Worked examples
Full replacement (IRS training example): you buy 100 shares for $1,000, sell them for $750 on March 10, 2026, and buy 100 shares for $800 on March 25. The $250 loss is disallowed. Your basis in the new shares is $800 + $250 = $1,050, or $10.50 a share.
Partial replacement (Treasury regulation example): 100 shares with a $5,000 basis are sold for $4,000, a $1,000 loss ($10 a share). Within the window you buy 75 shares for $3,000. The loss on 75 shares, $750, is disallowed and added to those 75 shares (new basis $3,750). The loss on the other 25 shares, $250, is deductible now.
Edges of the window: for a March 10, 2026 sale, the window runs from February 8 to April 9, 2026. A purchase on April 9 (30 days after) counts; April 10 (31 days) doesn't.
Limitations
- Enter only replacement purchases. Don't list the shares you sold. If shares bought within 30 days before the sale were themselves sold in the same sale, they're part of the sale, not a replacement.
- "Substantially identical" isn't defined by a formula. The same company's stock is; a different company's usually isn't. Options and some funds can be. Ask a tax professional when unsure.
- Other accounts count. Purchases by your spouse or in your IRA can trigger the rule. A loss disallowed because of an IRA purchase isn't added to any basis, so it's lost for good.
- Brokers report wash sales they can see on Form 1099-B, but only within the same account. You're responsible for the rest.
This is an educational estimate, not financial, tax, legal or investment advice. Check the numbers with your own documents, lender or tax professional before you act.
Sources
- IRS Publication 550: Investment Income and Expenses (stock splits, fractional shares, wash sales)
- 26 U.S. Code § 1091: Loss from wash sales of stock or securities (Cornell LII)
- 26 CFR § 1.1091-1: Losses from wash sales (61-day period; matching in order of acquisition)
- IRS VITA/TCE training: Wash sales case study ($250 loss added to the new basis)