Wash Sale Calculator

Enter your sale and repurchase details to see how much of your capital loss the IRS wash sale rule disallows.

How it is calculated

The tool assumes you already know you repurchased within the 30-day window; it does not take dates, it only splits the loss by share count.

loss per share = cost basis − sale price
total loss = shares sold × loss per share
matching shares = min(shares sold, shares repurchased)
disallowed = matching shares × loss per share
allowed = total loss − disallowed
new basis = repurchase price + disallowed ÷ matching shares

All prices are dollars per share. The disallowed amount is not lost; it is added to the basis of the matching replacement shares only. If you bought back more than you sold, the extra shares keep their plain repurchase price, and the new basis shown is per matching share. If the sale was at a gain or breakeven (sale price not below cost basis) there is no loss and no result is shown. Zero shares sold, zero shares repurchased or a zero cost basis also give no result.

Worked example

You sold 100 shares at $40 that cost $50 each, then bought back 60 shares at $41. The loss is 50 − 40 = $10 per share, so the total loss is 100 × 10 = $1,000. Only 60 shares were replaced, so the disallowed loss is 60 × 10 = $600.00. The other 40 shares keep their loss: 1,000 − 600 = $400.00 allowed now. The $600 is added to the 60 replacement shares: 41 + 600 ÷ 60 = $51.00 new cost basis per share.

Try this example →

Common mistakes

  • Entering the sale price at or above the cost basis. A gain is not a wash sale; the tool returns nothing instead of a disallowed amount of zero.
  • Entering the total proceeds rather than the price per share. Both price fields are per share, and the share counts are separate fields.
  • Treating the disallowed loss as gone for good. It is moved into the basis of the repurchased shares and is recovered when you finally sell them.
  • Entering a repurchase of zero to see the loss as fully allowed. With zero shares repurchased the tool shows no result; if nothing was bought back, the whole loss is simply deductible and no wash-sale calculation is needed.
  • Forgetting that the tool does not check dates or whether the securities are substantially identical. It only does the arithmetic; you decide whether the rule applies, and other countries have different rules.

About this calculator

The IRS wash sale rule (Internal Revenue Code Section 1091) disallows a tax deduction for a capital loss if you buy the same or a 'substantially identical' security within a 61-day window: 30 days before the sale, the day of the sale, or 30 days after. It exists to stop investors from selling a losing position purely to claim a tax deduction while immediately buying it back and keeping their market position unchanged.

When the rule is triggered, the disallowed loss is not simply lost — it is added to the cost basis of the newly repurchased shares, which reduces your taxable gain (or increases your deductible loss) when you eventually sell those replacement shares for good. The portion of your original loss that falls outside the repurchase, if any, remains an allowed loss you can deduct right away.

Investors and tax preparers run this calculation especially during tax-loss harvesting season at year-end, when it's common to sell a losing stock or fund for the tax benefit while wanting to stay invested in a similar position — this calculator shows exactly how much of the loss the wash sale rule disallows and what your adjusted cost basis becomes.

Was this helpful?

You can pick up to 3 reactions.

Comments

  • Be the first to comment.

Popular calculators

All Calculators