HandyWorkLab

Home › Stock market crash and correction history

Wash Sale Calculator: 30-Day Rule Dates, Disallowed Loss and New Basis

Sold a stock or fund at a loss and want to buy it back? Enter the sale date and the numbers from your trade. The calculator shows the 30-day window before and after the sale, the first day you can repurchase without triggering the wash sale rule, and, if you already bought back, how much of the loss is disallowed, the adjusted cost basis of the new shares and their adjusted holding period.

The sale at a loss
Replacement purchase (optional)

How to use the wash sale calculator

Enter the date you sold at a loss, the date you originally bought the shares you sold, how many shares you sold, their cost basis per share and the sale price. Your broker's trade confirmation or the "closed lots" view shows all of these. If you only want to know when you can safely buy back, you can stop there and clear the replacement fields: the result shows the full window and the first safe purchase date.

If you have already bought the same security again, or plan to, enter that purchase date, the number of shares and the price. The calculator checks whether the purchase falls inside the window, how many of your loss shares it matches, how much loss is disallowed, the adjusted basis of the replacement shares and the date from which they count as held for more than one year.

How the wash sale rule is applied

The window. It starts 30 calendar days before the sale date and ends 30 calendar days after it. Weekends and holidays count. A purchase on any day from the first to the last day of the window is a replacement purchase. The first safe day to buy back is the 31st day after the sale.

Matching shares. Replacement shares are matched one for one with the shares sold at a loss. If you sold 100 shares and bought back 60 inside the window, the loss on 60 shares is disallowed and the loss on the other 40 stays deductible. If you bought back more than you sold, only as many replacement shares as you sold get an adjusted basis.

Adjusted basis. The disallowed loss per share is added to the cost of each matched replacement share: new basis = replacement price + (old basis − sale price). That is why a wash sale defers the loss rather than destroying it, unless the replacement was bought in an IRA.

Holding period. The matched replacement shares inherit the holding period of the shares you sold. In practice, their acquisition date moves back by the number of days you held the original shares. A sale more than one year after that adjusted date is long-term.

Worked example

You bought 100 shares on March 2, 2026 at $180 and sold them on November 20, 2026 at $140, a $40 loss per share or $4,000 in total. The wash sale window runs from October 21 to December 20, 2026, so December 21 is the first safe day to buy back. Instead you buy 60 shares on December 5 at $135. That is inside the window, so the loss on 60 shares, $2,400, is disallowed and $1,600 remains deductible for 2026. Each of the 60 new shares has a basis of $135 + $40 = $175. You held the originals for 263 days, so the new shares are treated as bought on March 17, 2026, and a sale after March 17, 2027 is long-term.

Limitations

This tool handles one sale and one replacement purchase. Real portfolios can create chains of wash sales across many lots, partial fills, options and dividend reinvestments; brokers track those only inside a single account, while the rule applies across all your accounts and your spouse's. Whether two different funds are substantially identical is a judgement the calculator cannot make. For the bigger picture of using losses against this year's gains, see the tax loss harvesting calculator.

Frequently asked questions

What is the wash sale rule?

Under section 1091 of the US tax code, you cannot deduct a loss from selling a stock or security if you buy the same or a substantially identical security within 30 days before or after the sale. The disallowed loss is not lost forever: it is added to the cost basis of the replacement shares.

How many days do I have to wait to buy back a stock sold at a loss?

The window is 30 calendar days on each side of the sale date, 61 days in total counting the sale day. To be outside it, buy back on the 31st day after the sale or later. If you sold on December 1, 2026, the window runs through December 31, so January 1, 2027 is the first safe day.

Does the wash sale rule apply to buying before I sell?

Yes. Purchases in the 30 days before the sale count too. Buying extra shares on a dip and then selling your older, higher-cost shares at a loss within 30 days is a classic accidental wash sale. The rule matches the loss shares against the replacement shares one for one.

What counts as substantially identical?

The same stock, options or contracts to buy it, and generally another share class of the same fund are treated as substantially identical. Two funds tracking the same index from different issuers are a grey area the IRS has not settled. Shares of a different company in the same industry are normally not substantially identical.

Does buying in my IRA trigger a wash sale?

Yes. The IRS ruled in Revenue Ruling 2008-5 that buying the replacement shares in your IRA or Roth IRA triggers the wash sale rule, and because the basis cannot be added to the IRA shares, the loss is permanently lost. Purchases by your spouse, and automatic dividend reinvestments, can also count.

Not tax advice. This calculator applies the basic wash sale arithmetic to one sale and one replacement purchase. Brokers report wash sales only within the same account; you are responsible for all of your accounts.

Last updated 2026-11-21. Runs entirely in your browser; nothing you enter is uploaded.

More in Stock market crash and correction history