The wash sale rule stops you from claiming a tax loss on a security and then buying the same one right back. If you buy substantially identical shares within 30 days before or after the sale, the loss on the matching shares is disallowed for now and added to the cost basis of the shares you bought. This calculator shows how much of your loss is disallowed, how much you can deduct and the new basis.
How the calculation works
- Loss per share = purchase price − sale price (if positive)
- Shares affected = the smaller of the shares sold and the shares bought back in the window
- Disallowed loss = loss per share × shares affected
- Deductible loss = total loss − disallowed loss
- New basis of the shares bought back = their price + the disallowed loss
- The holding period of the old shares carries over to the new ones
Example
You bought 100 shares at $50 and sold them at $40, a loss of $1,000. Within 30 days you buy 60 shares back at $42. The wash sale applies to 60 shares, so $600 of the loss is disallowed and $400 is deductible now. The disallowed loss moves into the new shares: their basis is $3,120, or $52.00 a share instead of $42. At a 24 % rate, the deductible loss is worth $96 this year and the deferred part, $144, comes back when you sell the new shares.
Why it matters
Many investors trigger the rule by accident: with automatic dividend reinvestment, in a second account or in a spouse’s account. The loss is not lost, it is deferred, but a deferral can push a deduction into another tax year, or erase it if the new shares are bought in an IRA, where the disallowed loss is not added to any basis. Knowing the adjusted basis helps you keep correct records for the later sale.
Good to know
The 61-day window includes purchases made before the sale. The rule also applies to options and contracts on the same security, and to purchases by your spouse or by a company you control. It applies only to losses: a sale at a gain is not affected. Shares are matched in a set order and partial matches are possible, as in the example. To keep market exposure while harvesting a loss, investors often buy a similar but not substantially identical fund. What counts as substantially identical is a matter of facts and circumstances.
In practice
Wait 31 days before buying the same security back, turn off dividend reinvestment around a harvest, and check all your accounts. Your broker reports adjusted basis for many cases but not all. This tool is for education and is not tax advice.