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.
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.