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.

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.

