Wash-Sale Rule Calculator
Check whether a tax-loss-harvesting sale trips the wash-sale rule, how much loss is disallowed, and the new basis of your replacement shares.
How it works
Disallowed loss = loss/share · min(shares repurchased, shares sold) · New basis = repurchase price + disallowed loss ÷ replacement shares
The wash-sale rule disallows a loss when you buy the same or a substantially identical security within 30 days before or after the sale (a 61-day window). The disallowed portion is scaled to how many replacement shares you bought — buy back all of them and the whole loss is deferred; buy back half and half the loss is still deductible now. The deferred loss is not gone: it is added to the cost basis of the replacement shares, so you claim it when you finally sell those.
Worked example
100 shares bought at $60 and sold at $45 is a $15 × 100 = $1,500 loss. Repurchasing all 100 within 30 days disallows the full $1,500. Those new shares, bought at $47, take a basis of 47 + 15 = $62 each, so the loss returns when you sell them.
Frequently asked questions
Is the disallowed loss lost forever?
No. It is deferred, not forfeited. The disallowed amount is added to the cost basis of the replacement shares, so you recover the tax benefit when you eventually sell those shares (and their holding period also carries over).
What counts as substantially identical?
The same stock, or options and contracts on it. Two different S&P 500 index funds from different providers are generally not treated as substantially identical, which is how harvesters stay invested while booking a loss — but the IRS has never defined the term precisely.
Does the 30 days run only after the sale?
No — it runs both directions. Any purchase from 30 days before through 30 days after the loss sale can trigger the rule, which is why a recent reinvested dividend or a DRIP buy can accidentally cause a wash sale.
Related calculators
Educational estimate, not investment or tax advice.