United States · Investments and tax

Wash sale rule calculator.

Enter a stock sale at a loss and the shares you bought around it. See how much of the loss is disallowed, what is still deductible and how the basis of the new shares changes.

A loss is disallowed when you buy substantially identical stock or securities within 30 days before or after the sale, a 61-day window. The disallowed loss is added to the basis of the replacement shares and their holding period includes the old one.

IRS Publication 550 (2025)Verified October 1, 2026

Advertisement

Your trades

Substantially identical shares you bought

Add up to four purchases. Leave unused rows blank. Purchases outside the 61-day window are ignored.

Purchase 1
Purchase 2
Purchase 3
Purchase 4

Your estimate

How the wash sale rule works

If you sell stock or securities at a loss and, within 30 days before or after the sale, you buy substantially identical stock or securities, acquire them in a fully taxable trade, acquire a contract or option to buy them, or acquire them for your IRA or Roth IRA, the loss is not deductible. If your spouse or a corporation you control buys substantially identical stock, that is a wash sale too. The window runs 30 days before the sale through 30 days after, which is 61 days including the sale date.

Formula: disallowed loss = total loss × matched shares ÷ shares sold. Matched shares are the replacement shares matched to the shares sold, in the order you bought them. Allowed loss = total loss − disallowed loss. Each matched lot’s basis rises by its share of the disallowed loss.

Worked example (IRS Publication 550)

You bought 100 shares of M stock for $5,000 and sold them January 3, 2025 for $4,000, a $1,000 loss. In the 30 days before, you bought 50 shares on December 13, 2024 for $2,750 and 25 shares on December 20, 2024 for $1,125. Seventy-five shares are matched, so $1,000 × 75 ÷ 100 = $750 is disallowed and $250 is deductible. The 50-share lot gets two-thirds of $750 ($500), so its basis is $3,250. The 25-share lot gets $250, so its basis is $1,375. The form above is preloaded with this example.

What this page does not do

Official source: IRS Publication 550, Investment Income and Expenses (2025), section “Wash Sales”, read October 1, 2026. IRS Topic 409 covers general capital gains and losses but not wash sales, so it is not used for these figures. The rule has no dollar thresholds or rates, so there are no yearly numbers to go stale.

Frequently asked questions

Does the wash sale rule apply to gains?

No. It only disallows losses. A sale at a gain is taxed normally.

Is the loss gone forever?

No. It is added to the basis of the replacement shares, so it is postponed until you dispose of them, and the holding period of the old shares carries over.

What if I buy fewer shares back than I sold?

Only the loss on the matched shares is disallowed. In Publication 550, buying back 75 of 100 shares disallows $750 of a $1,000 loss and leaves $250 deductible.

Does buying in my IRA count?

Yes. Publication 550 lists acquiring substantially identical stock for your IRA or Roth IRA as a wash sale.

Is there a Canadian version?

Canada has a similar 30-day rule called the superficial loss rule; see the Canadian calculator linked above.

Estimate only

This page is educational and is not tax advice. Confirm with Publication 550, your broker’s Form 1099-B or a tax professional. Calculations run in your browser; nothing is sent anywhere.

Advertisement
Advertisement