Calculateus

Wash Sale Rule Calculator

Check whether a stock or fund repurchase falls inside the 61-day wash sale window and see the disallowed loss.

Result

Wash Sale Triggered?
Yes - loss partially or fully disallowed
Disallowed Loss
$2,000.00
Currently Deductible Loss
$0.00
Disallowed Amount Added to New Cost Basis
$2,000.00

The wash sale rule disallows a loss if you buy the same or a 'substantially identical' security within 30 days before or after the sale (a 61-day window total). The disallowed loss isn't gone permanently - it's added to the cost basis of the repurchased shares, deferring the tax benefit until those shares are eventually sold outside any wash sale window.

About the Wash Sale Rule

This calculator checks whether a stock or fund trade falls inside the IRS wash sale window and, if so, how much of the realized loss becomes disallowed for current-year tax purposes. It is built for investors who sell a losing position and are considering (or have already made) a repurchase of the same or a substantially identical security within a matter of days.

How It Works

Enter the realized loss on the sale, the number of days between the sale and the repurchase, and the percentage of the original share count you bought back. The tool flags a wash sale whenever the repurchase happens within 30 days of the sale, then disallows the loss in proportion to how much of the position was reacquired, leaving the rest currently deductible.

isWashSale = daysBetween <= 30. disallowedLoss = isWashSale ? sellLoss x (min(sharesRepurchased, 100) / 100) : 0. allowedLoss = sellLoss - disallowedLoss. The disallowedLoss amount is also the figure added to the cost basis of the repurchased shares.

Formula & Methodology

Start with the dollar loss from the sale. Convert the repurchase percentage to a decimal, capping it at 100% even if more shares were somehow reacquired than sold. If the gap between the sale date and the repurchase date is 30 days or fewer, multiply the loss by that decimal to get the disallowed portion; subtracting the disallowed amount from the total loss gives the loss you can currently claim. If the gap exceeds 30 days, the trade sits outside the wash sale window entirely, so none of the loss is disallowed regardless of how much stock was repurchased.

Examples

Full repurchase inside the window

An investor sells shares at a $2,000 loss and buys the same number of shares back 20 days later. Since 20 days is within the 30-day window and 100% of the position was repurchased, the full $2,000 loss is disallowed for the current year and instead gets added to the cost basis of the new shares.

Partial repurchase inside the window

An investor realizes a $3,000 loss and repurchases only 50% of the original share count 10 days later. The wash sale rule still applies because the repurchase falls inside 30 days, but only $1,500 of the loss is disallowed, leaving $1,500 currently deductible.

Advantages

  • Gives a quick yes-or-no read on whether a specific repurchase timeline triggers the wash sale rule before the trade is finalized.
  • Separates the disallowed loss from the still-deductible portion, which matters for accurately reporting Schedule D and Form 8949 amounts.
  • Shows the exact dollar figure that gets added to the new position's cost basis, so the deferred benefit is not overlooked when those shares are eventually sold.

Common Mistakes

  • Assuming the wash sale window only counts the days after the sale, when the IRS rule also disallows losses on shares bought in the 30 days before the sale.
  • Believing a disallowed loss is permanently lost rather than deferred into the new shares' cost basis, which can reduce a future gain or increase a future loss when those shares are sold.
  • Overlooking that a partial repurchase only disallows a proportional share of the loss, not the entire amount, leading to underreporting of the currently deductible loss.

Edge Cases to Watch For

  • The tool treats the window as a simple day count up to and including 30 days; the IRS rule actually spans 61 days total (30 days before the sale through 30 days after), so a repurchase before the sale can trigger the same disallowance even though this calculator only takes days after the sale as an input.
  • A repurchase percentage entered above 100% is capped at 100% before the math runs, since you cannot disallow more loss than was originally realized.
  • Buying back only part of the position produces a proportional disallowance; the untouched portion of the loss remains deductible in the current year even when the trade is a wash sale.
  • A gain on the original sale is outside the scope of this calculator's logic, since only losses can be disallowed under the wash sale rule.

Common Use Cases

  • Tax-loss harvesters who want to sell a losing position and confirm how many days they must wait before repurchasing to preserve the full deduction.
  • Investors who already repurchased shares quickly and need to know the disallowed amount for accurate tax reporting.
  • Anyone rebalancing a portfolio who wants to see the trade-off between staying invested and keeping a loss deduction intact.
Written & fact-checked by the Calculateus TeamLast updated August 5, 2026How we verify our formulas

Frequently asked questions

Does the wash sale rule apply to gains too, or only losses?

Only losses - the wash sale rule exists specifically to prevent taxpayers from selling a losing position purely to harvest a tax deduction while immediately buying it back to maintain the same market position. Selling for a gain and rebuying has no such restriction since there's no loss being manufactured.

Conclusion

The wash sale rule turns an otherwise straightforward capital loss into a timing question, and this calculator translates the days-and-percentage details of a specific trade into a concrete disallowed and allowed loss figure. Running the numbers before a repurchase can clarify whether waiting a few more days preserves a deduction that would otherwise be deferred.