Wash Sale Rule Calculator
You sold a stock at a loss and bought it right back. The IRS calls that a wash sale, and the loss you were counting on disappears from this year’s return. This wash sale rule calculator checks your actual dates against the IRS 61-day window, tells you whether the loss survives, and computes the adjusted cost basis of your replacement shares.
Enter the sale, then the nearest repurchase of the same or substantially identical security in any account, including an IRA or a spouse’s account. If you are pricing the tax value of a harvested loss first, our capital gains and loss calculator nets your gains and losses before the wash sale check.
Educational estimate only, based on 26 U.S.C. Section 1091. “Substantially identical” is fact-specific; confirm with a tax professional.
Quick Answer
Sell 100 shares at a $2,000 loss on March 15 and rebuy 100 shares at $85 on March 25, and the wash sale rule disallows the full $2,000 loss this year. The loss is not gone: it raises the replacement shares’ basis to $10,500 ($105/share), deferring the benefit until you sell those shares for good.
The short version
- The window is 61 days: 30 days before the sale, the sale day, and 30 days after. Any purchase of the same or substantially identical security inside it triggers the rule.
- It crosses accounts: purchases in your IRA, Roth IRA, or a spouse’s account count. So do automatic dividend reinvestments.
- Disallowed is not destroyed: the loss is added to the replacement shares’ cost basis and recovered later.
- Partial repurchases mean partial wash sales: rebuy half the shares and only half the loss is disallowed.
Worked example, run through the real tool
Pre-filled values: sale of 100 shares on 2026-03-15, basis $100, sale price $80; repurchase of 100 shares at $85 on 2026-03-25.
Step 1: loss = ($100 – $80) x 100 = $2,000. Step 2: window = February 13 through April 14, 2026. Step 3: March 25 is inside the window, so the wash sale triggers. Step 4: disallowed = $2,000 x (100/100) = $2,000. Step 5: adjusted basis = (100 x $85) + $2,000 = $10,500, or $105 per share. Press Calculate to reproduce every figure.
Now change the repurchase to 40 shares: only 40 of the 100 sold shares are “washed,” so disallowed = $2,000 x 0.4 = $800, allowed this year = $1,200, and the 40 replacement shares carry a basis of (40 x $85) + $800 = $4,200 ($105/share). The tool handles this partial math automatically.
The 61-day window, exactly
Under 26 U.S.C. Section 1091, a loss is disallowed when you acquire, or enter a contract or option to acquire, substantially identical stock or securities within 30 days before or 30 days after the sale. That is 61 days total, centered on the sale date, and the rule counts calendar days, not trading days.
Three details trip people up. First, the window looks backward too: buying 20 days before you sell at a loss triggers it just as surely as buying 20 days after. Second, it ignores account boundaries: the IRS applies it across all your accounts, and the courts have extended it to IRAs and spouses’ accounts. Third, “substantially identical” reaches beyond the exact ticker: options on the stock and ETFs tracking the same index can qualify, while stock of a different company in the same industry generally does not.
Four traps that cause accidental wash sales
- Dividend reinvestment plans (DRIPs). An automatic reinvestment inside the window is a purchase. Turn off reinvestment on the security before you harvest the loss.
- Your IRA. Repurchasing inside an IRA is the worst version of the trap: the loss is disallowed and the basis adjustment is wasted, because the IRA’s basis does not matter for tax. Never rebuy a harvested loser inside a retirement account.
- A spouse’s account. Purchases by a spouse in a joint filing household count. Coordinate before either of you trades.
- Buying before the sale. Averaging down two weeks before you capitulate and sell still triggers the rule. The 30-day lookback has no intent requirement: accidents count.
The safe way to harvest: sell the loser, wait 31 days, then rebuy, or immediately buy something similar but not substantially identical (a different index fund in the same sector). Either way the loss stays deductible and your market exposure barely changes.
What happens to the disallowed loss
A wash sale defers the loss; it does not erase it. The disallowed amount is added to the cost basis of the replacement shares, which shrinks your future gain (or deepens your future loss) when you sell them without triggering another wash sale. In the worked example, the $2,000 disallowed loss turns $8,500 of replacement shares into a $10,500 basis: sell later at $110 and the taxable gain is $500 instead of $2,500.
That deferral is why the rule matters most at year-end. A December wash sale pushes the deduction into the next tax year, which is exactly what harvesters were trying to avoid. Run your sale and repurchase dates here before you trade, not after. To see how long the replacement shares need to recover at a plausible growth rate, run them through our investment growth calculator. And remember the loss still has to survive the normal capital loss limits once allowed: after offsetting gains, only investment gains net out first, then up to $3,000 a year against ordinary income, with the rest carried forward.
What competing calculators miss
The typical wash sale tool does basis math only: enter the numbers, get the adjusted basis. Calculator Ultra follows that pattern, and complete.tools explains the 61 days well but never checks your dates. Neither warns you about the IRA trap, where the disallowed loss buys you a basis adjustment inside an account whose basis is meaningless.
This page checks the actual calendar: enter both dates and it maps your personal 61-day window, flags inside versus outside, and handles partial repurchases share by share. It also states the cross-account traps up front, because a wash sale calculator that only sees one brokerage account is checking half the rule.
Frequently asked questions
An IRS rule (Section 1091) that disallows a loss on the sale of stock or securities if you buy the same or a substantially identical security within 30 days before or after the sale. It stops investors from harvesting tax losses while keeping essentially the same position.
61 days total: 30 days before the sale, the day of the sale, and 30 days after. Any purchase of a substantially identical security inside that window disallows the loss, proportionally if you buy fewer shares than you sold.
Yes, and it is the most punishing version. A repurchase inside an IRA or Roth IRA triggers the disallowance, but the basis adjustment lands inside a tax-advantaged account where it has no value. The loss is effectively destroyed, not deferred.
The same company’s stock, options to buy that stock, and mutual funds or ETFs tracking the same index generally qualify. Stock of a different company, even in the same industry, generally does not. Bonds of the same issuer are judged on terms and conditions.
No. It is added to the cost basis of the replacement shares, deferring the tax benefit until you sell those shares without triggering another wash sale. Sell the replacements later at a gain and the higher basis shrinks the taxable profit.
Only the matching portion is disallowed. Sell 100 shares at a $2,000 loss and rebuy 40, and $800 is disallowed while $1,200 stays deductible. The $800 adjusts the basis of the 40 replacement shares.
Yes. An automatic dividend reinvestment is a purchase like any other. If it lands inside the 61-day window around a loss sale, the rule triggers. Disable reinvestment on the security before harvesting the loss.
Currently no. The IRS treats cryptocurrency as property, not a security, so Section 1091 does not apply to it. Congress has repeatedly proposed extending the rule to digital assets, so check current law before relying on this.
Either wait 31 days after the sale before repurchasing, or immediately buy a security that is similar but not substantially identical, such as a different index fund in the same sector. Also turn off dividend reinvestment and coordinate with your spouse’s accounts.
References
- Internal Revenue Service. "Topic No. 409, Capital Gains and Losses." IRS: Topic No. 409, Capital Gains and Losses (Accessed Oct 19, 2026).
- Internal Revenue Service. "Publication 550, Investment Income and Expenses (Chapter 4, Wash Sales)." IRS: Publication 550, Investment Income and Expenses (Accessed Oct 19, 2026).
- Legal Information Institute, Cornell Law School. "26 U.S. Code Section 1091 - Loss from wash sales of stock or securities." Cornell LII: 26 U.S.C. Section 1091 (Accessed Oct 19, 2026).
- Internal Revenue Service. "Publication 551, Basis of Assets." IRS: Publication 551, Basis of Assets (Accessed Oct 19, 2026).
- Internal Revenue Service. "Instructions for Form 8949, Sales and Other Dispositions of Capital Assets." IRS: Instructions for Form 8949 (Accessed Oct 19, 2026).
- Internal Revenue Service. "Instructions for Schedule D (Form 1040), Capital Gains and Losses." IRS: Instructions for Schedule D (Accessed Oct 19, 2026).
- Investopedia. "Wash-Sale Rule: What It Is and How It Works." Investopedia: Wash-Sale Rule (Accessed Oct 19, 2026).
