The wash sale rule in one paragraph
Under the US wash sale rule, 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, you cannot deduct the loss now. The window is 61 days long: the 30 days before, the day of the sale and the 30 days after. The loss is not gone. It is added to the cost basis of the replacement shares, and the holding period of the old shares carries over.
disallowed loss = loss × min(shares bought, shares sold) ÷ shares sold
new basis per replacement share = purchase price + disallowed loss ÷ replacement shares
A worked example
With the figures loaded above you sell 100 shares on 20 November 2026 at $40, having paid $50: a $1,000 loss. On 5 December you buy 60 shares back at $38.
- The window runs from 21 October to 20 December 2026, and 5 December is inside it.
- 60 of the 100 shares were replaced, so 60% of the loss is disallowed: $600. The other $400 can be claimed for 2026.
- The $600 is added to the 60 new shares: their basis becomes $38 + $10 = $48 a share. You get the loss back when you eventually sell them.
- The first date you could have bought back without triggering the rule was 21 December 2026.
Year-end dates for tax-loss harvesting
- For a loss to count in the 2026 tax year, the sale must happen by 31 December 2026 (trade date).
- To sell at a loss and buy back within 2026 without a wash sale, sell by 30 November 2026: the 31st day after is 31 December.
- Purchases in the 30 days before the sale count too. Buying more of a losing position in early December, then selling the original lot at a loss before year-end, is a wash sale.
Purchases in an IRA, or by your spouse, also trigger the rule, and a loss disallowed by an IRA purchase is not added to anything: it is lost. Buying call options on the same shares can count as acquiring substantially identical securities.
Australia is different
Australia has no fixed 30-day rule. Instead, the ATO treats a sale and repurchase made mainly to create a tax loss as a wash sale that can be cancelled under the general anti-avoidance provisions (Part IVA), whatever the gap between the trades; its view is set out in taxation ruling TR 2008/1. There is no “safe” number of days. Whether you are a share trader or an investor also changes how losses are treated: see share trader or share investor?
For setting aside tax on trading gains as you go, see how much to set aside for taxes when self-employed in the US.