Pro Calculators and Guides

The Wash Sale Rule Explained: How Much of Your Stock Loss Is Disallowed

Understand the 30-day wash sale window, partial repurchases and the adjusted basis, with a worked example and a free calculator to test your trades.

Saizul Amin
Saizul Amin23 Oct 2026 · 3 min read
The Wash Sale Rule Explained: How Much of Your Stock Loss Is Disallowed

The Wash Sale Rule Explained

Selling a stock at a loss to cut your tax bill is a common move at the end of the year. The wash sale rule is the reason it does not always work. The Wash Sale Rule Loss Calculator shows how much of a loss is disallowed and what your new cost basis becomes.

The rule in one paragraph

If you sell a security at a loss and buy the same or a substantially identical security within 30 days before or after the sale, the loss is disallowed for now. The window is 61 days long: 30 days before the sale, the day of the sale and 30 days after. The loss is not erased. It is added to the cost basis of the replacement shares, so you get the benefit when you finally sell them.

Partial repurchases

The rule works by matching shares. If you sell 100 shares at a loss and buy back 60, only the loss on 60 shares is disallowed; the loss on the other 40 can be claimed. The tool takes the smaller of the shares sold and bought as the matched number and splits the loss in proportion.

What changes after a wash sale

Two things carry over to the replacement shares: the disallowed loss, added to the basis, and the holding period of the shares you sold. This is why a wash sale can turn a short-term position into a long-term one.

Using the calculator

Enter the shares sold, the basis per share, the sale price and the sale date. Then enter the shares bought back, the price and the date. The result shows:

  • the total loss on the sale,
  • the gap in days between sale and purchase,
  • whether the purchase is inside the window,
  • the number of matched shares,
  • the disallowed and the allowed loss,
  • the new basis per replacement share,
  • the tax saved on the allowed loss at the rate you enter,
  • the first day on which you could buy back without triggering the rule.

A worked example

You sell 100 shares with a basis of $50 at $40, a loss of $1,000 on November 10. Fifteen days later you buy 60 shares at $41. Sixty of the 100 shares are replaced, so $600 of the loss is disallowed and $400 can be claimed this year. The new shares have a basis of $41 plus $10 per share, which is the $600 spread across the 60 shares, so $51. If the purchase had been on December 12, 32 days after the sale, nothing would be disallowed.

Traps people miss

  • The rule applies across your accounts, including IRAs. A purchase in an IRA can cause a permanent loss of the deduction.
  • It applies to purchases made by a spouse, and automatic dividend reinvestment can count as a purchase.
  • Options and contracts on the same stock can be considered substantially identical.
  • Your broker only reports wash sales on identical securities in the same account.

A practical routine

Before you sell for a loss, look at your purchase history for the last 30 days and your planned purchases for the next 30. If you want to stay invested, consider an investment that is similar but not identical, such as a fund that tracks a different index, and ask a tax professional about close cases.

This tool is for understanding. It is not tax advice, and it does not replace your broker's statement.

Quick questions

Does the rule apply if I sell one fund and buy another? Only if the two are substantially identical, for example two funds tracking exactly the same index from the same provider. Different indexes are usually fine, but the line is not always clear.

What if I sell at a gain and buy back? Nothing happens: the rule only matters for losses.

Can I still use the loss later? Yes, through the higher basis of the replacement shares, which lowers your gain when you sell them.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages