Wash Sale Rule Calculator United States

This wash sale calculator shows how much of a capital loss the IRS disallows if you repurchase within 30 days, what stays deductible and the basis adjustment.

Wash Sale Rule Calculator United States
US$
Disallowed loss —
Allowed (deductible) loss —
Position replaced —
Added to replacement basis —

We always strive to use the latest data for every variable so our results and reports are as accurate as possible. Even so, errors are possible — you should not rely on this tool or its report alone, and we accept no liability for any decision made based on it.

What it does

The Wash Sale Rule Calculator shows how much of a capital loss the IRS disallows when you repurchase a substantially identical security within 30 days, and how much loss you can still deduct.

Data sources & parameters

This calculator uses standard financial formulas and runs entirely in your browser. It needs no external rate data — your result is computed only from the values you enter above.

We always strive to use the latest data for every variable so our results and reports are as accurate as possible. Even so, errors are possible — you should not rely on this tool or its report alone, and we accept no liability for any decision made based on it.

The formula

Disallowed loss = loss × min(1, shares repurchased ÷ shares sold); allowed loss = loss − disallowed

How it works

It prorates the loss by the share of the sold position that was replaced inside the wash-sale window, disallows that portion, and adds it to the basis of the replacement shares.

Where it is used

  • Checking whether a tax-loss harvest triggers a wash sale
  • Splitting a partial-replacement loss into disallowed and allowed portions
  • Finding the basis adjustment on replacement shares

Worked example

Selling 100 shares for a $5,000.00 loss and buying back 60 within 30 days disallows … and leaves … deductible, with … added to the replacement basis.

What the wash sale calculator does

If you sell a security at a loss and buy back a substantially identical one around the same time, the IRS wash-sale rule can disallow part or all of the loss. Enter the loss, the shares sold and the shares repurchased within the window, and the calculator splits the loss into the disallowed and still-deductible parts and shows how much is added to the basis of your replacement shares.

Investors often sell a losing position to harvest the loss and then rebuy because they still want the exposure. The rule stops that from producing a deduction when the investor's position has barely changed.

Why the rule matters

A capital loss offsets capital gains and, within limits, ordinary income. Without the wash-sale rule, an investor could sell at a loss on the last day of December, claim the deduction, and rebuy the next morning with almost no change in risk.

The disallowed loss is deferred, not erased: it is added to the cost basis of the replacement shares. When you later sell those shares without triggering another wash sale, the higher basis lowers your taxable gain or increases your loss.

How the calculation works

  • It measures the fraction of the sold position you replaced within the window, calculated as shares repurchased divided by shares sold, capped at 100 percent.
  • It multiplies your total loss by that fraction to find the disallowed loss.
  • It subtracts the disallowed portion from the total loss to find the amount you can still deduct.
  • It reports the disallowed amount again as the figure added to the basis of your replacement shares.

Replace every share and the whole loss is disallowed; replace none within the window and the whole loss stays deductible. With a partial replacement, the number of shares you buy back decides the split.

The 30-day window

The window is fixed by law: 30 calendar days before the sale and 30 after, a 61-day span around the sale date. A purchase shortly before the sale counts just as one afterwards does. Because the period never changes, the calculator uses no rate or threshold parameters.

The rule can also be triggered by buying a substantially identical security in another account, including an IRA, or through a spouse, and options or contracts to acquire the security can count too. The calculator handles only the share arithmetic.

What counts as substantially identical

Shares of the same company clearly qualify. Two index funds tracking the same index may or may not, depending on the facts. Investors who want to stay invested while harvesting a loss often switch to a related but genuinely different holding, then wait out the window before switching back. Use the calculator for the arithmetic, not to decide whether a particular swap is safe.

Reading your result

The output shows the disallowed loss first, then the loss you can still claim this year, the percentage of the position replaced, and the basis adjustment carried into your replacement shares. If the disallowance would wipe out most of the benefit you wanted, you could buy back fewer shares, wait until the window closes, or choose a security that is not substantially identical. Change the inputs to compare these before you place a repurchase order.

This is general information only and not financial advice.

About This Wash Sale Calculator

Use this wash sale calculator to get an instant estimate based on the figures you enter. Adjust the inputs above to match your situation, or browse all our calculators to plan your next step.

Frequently asked questions

What is the wash sale rule?
The wash-sale rule disallows a capital loss when you buy a substantially identical security within 30 days before or after the sale that produced the loss. The disallowed loss is not lost forever; it is added to the cost basis of the replacement shares.
How does this wash sale calculator work?
You enter the loss, the number of shares sold, and how many shares you repurchased within the 30-day window. The tool prorates the loss by the replaced share of the position, disallows that portion, and shows the deductible remainder and the basis adjustment.
What counts as the 30-day window?
The window runs 30 days before and 30 days after the sale, a 61-day span in total. A purchase of a substantially identical security anywhere in that period can trigger the rule.
What happens to a disallowed loss?
It is not deductible in the current year, but it is added to the cost basis of the replacement shares. That higher basis reduces a future gain or increases a future loss when you eventually sell the replacement shares.
Does the rule apply if I only repurchase part of the position?
Yes, but only proportionally. If you replace half the shares you sold, roughly half the loss is disallowed and the other half stays deductible. This calculator handles partial replacement by prorating the loss.
Is this tax advice?
No. This is a general estimate to illustrate how the wash-sale rule works. Substantially identical is a facts-and-circumstances judgment, and situations vary, so confirm your specific case with a tax professional.

About the author

Taha Kheirandish

Written and reviewed by

Taha Kheirandish

Economics student and independent researcher

Taha Kheirandish reads tax codes the way other people read maps — to find out where a system actually leads, not where it claims to go.

He is an economics student, and his work here is comparative by design. A pension deferral bonus in Quebec, a commuting allowance in Germany, a rent-increase ceiling in the Netherlands: each is a decision a government made about how money should move, and each reads differently once you set it beside eight others. He builds and checks these calculators across nine markets from primary sources — the regulation rather than a summary of it, the ministry’s own circular rather than a news item quoting it.

That is the editorial standard of the site as well as his habit. Every rate, threshold and bracket here carries the document it was read from and the date it takes effect, and gets re-checked when the law moves rather than when someone happens to notice.

He is a researcher, not a licensed adviser, and nothing on this site is personal financial advice. It is arithmetic done carefully with its sources shown — so that you can check it, and take it to someone who is.

Leave a Reply

Your email address will not be published. Required fields are marked *