Calcist

Style

Buttons

Spacing

How much to show

Decimal places

Text size

Wash sale calculator

Enter a sale at a loss and any purchases of the same stock around it. See which purchases fall in the 61-day window, how much of the loss is disallowed, and the adjusted cost basis of the replacement shares.

The sale at a loss

Purchases of the same (substantially identical) stock

Date boughtSharesTotal cost
$
$
$

Private: calculated on your device. Nothing you type is sent anywhere.

Next: Working out the tax on what you can deduct? Use the capital gains tax calculator.

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.

Window = sale date − 30 days to sale date + 30 days
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

How we checked this

Before every update, this calculator is run in a real browser with these known answers, and it must match all of them:

  • IRS example: $250 loss, 100 shares rebought for $800: $250 disallowed ✓
  • …new basis $1,050 ✓
  • Regulation example: 75 of 100 shares replaced: $750 disallowed, $250 deductible ✓
  • Bought 30 days after counts, 31 days doesn't: all $1,000 disallowed, last lot unmatched ✓
  • …matched in date order: 40 then 60 shares, $1,000 disallowed ✓
  • Rebought 31 days later: whole loss deductible ✓
  • A sale at a gain isn't a wash sale ✓

Last checked October 26, 2026. Spotted something wrong? The math is done in your browser with the formula shown on this page, so you can check any result by hand.

Add this calculator to your website (free)

Paste this code into any web page. The calculator works on your page, resizes itself, has no ads and no tracking cookies, and nothing your visitors type is sent anywhere. More about embedding.

Questions people ask

What is the 30-day wash sale rule?

If you sell stock at a loss and buy the same or substantially identical stock within 30 days before or after the sale, you can't deduct the loss now. It's added to the cost basis of the new shares instead.

Is the wash sale window 30 or 61 days?

Both descriptions are right. It's 30 days before the sale, the sale date itself, and 30 days after: 61 days in total.

What happens to a disallowed wash sale loss?

It's added to the basis of the replacement shares, so you get the benefit when you sell them, as long as that sale isn't another wash sale. The holding period of the old shares carries over too.

What if I bought fewer shares than I sold?

Only the loss on the number of shares you bought back is disallowed. Sell 100 at a $10-a-share loss and buy back 75, and $750 is disallowed while $250 is deductible.

Does the wash sale rule apply to gains?

No. It only applies to losses. Selling at a gain and buying back the next day doesn't change anything.

Related calculators