Wash Sale Rule Calculator
Determine whether a repurchase triggers the wash sale rule, how much of your realized loss is disallowed, the adjusted cost basis on your new shares, and the tax benefit that is deferred rather than lost.
The disallowed loss is added to the cost basis of your repurchased shares. The tax benefit is deferred, not lost — it reduces your gain (or increases your loss) when you eventually sell the new position.
Results are estimates for informational purposes. The wash sale rule has specific conditions including a 30-day window before and after the sale. Consult a qualified tax professional for advice specific to your situation.
Understanding the Wash Sale Rule: How Disallowed Losses Work
The wash sale rule is a provision in U.S. tax law (Internal Revenue Code Section 1091) that prevents investors from claiming a tax deduction for a security sold at a loss if they repurchase the same or a substantially identical security within 30 days before or after the sale. The rule was designed to prevent investors from manufacturing artificial losses for tax purposes while maintaining essentially the same market position.
Understanding the wash sale rule is important for anyone who actively manages an investment portfolio, particularly those who engage in tax-loss harvesting — the practice of selling securities at a loss to offset capital gains and reduce tax liability. A wash sale does not permanently eliminate the tax benefit; instead, it defers the loss by adding it to the cost basis of the newly purchased shares.
What Triggers a Wash Sale?
A wash sale is triggered when three conditions are met simultaneously. First, you must sell a security at a loss — if the sale results in a gain or breaks even, the wash sale rule does not apply. Second, within the 61-day wash sale window (30 days before the sale, the day of the sale, and 30 days after the sale), you must purchase a substantially identical security. Third, the repurchased security must be substantially identical to the one you sold.
The term 'substantially identical' is not precisely defined in the tax code, but generally means the exact same stock or bond. Options and warrants on the same security can also trigger the wash sale rule in many circumstances. For mutual funds and ETFs, two funds tracking the same index from different providers are generally not considered substantially identical, which is one reason why investors sometimes swap similar (but not identical) ETFs during tax-loss harvesting.
The wash sale window is broader than many investors realize. If you sell a stock at a loss on December 15, you cannot buy it back until January 15 of the following year without triggering the rule. This means wash sale planning often extends across tax years.
How the Disallowed Loss Is Calculated
When a wash sale occurs, the realized loss is disallowed — meaning you cannot claim it as a deduction on your tax return for that year. The disallowed loss equals the full realized loss on the sale: (Sale Price - Purchase Price) x Number of Shares.
This disallowed loss is not simply forfeited. Instead, it is added to the cost basis of the repurchased shares. This adjusted cost basis means that when you eventually sell the replacement shares, your gain will be smaller (or your loss will be larger) by exactly the amount of the previously disallowed loss, effectively restoring the tax benefit at the time of the future sale.
For example, suppose you originally purchased 100 shares at $50 each ($5,000 total) and sold them at $40 each ($4,000), realizing a $1,000 loss. If you repurchased the same stock at $41 per share ($4,100 total) within 30 days, the wash sale rule applies. The $1,000 realized loss is disallowed, and your adjusted cost basis in the new 100 shares becomes $4,100 + $1,000 = $5,100, or $51 per share.
Adjusted Cost Basis and the Holding Period
The adjusted cost basis is the foundation of any future gain or loss calculation on the replacement shares. By raising the cost basis to include the disallowed loss, the IRS effectively ensures that the tax benefit is preserved for a future transaction. When you sell the replacement shares — provided you do not trigger another wash sale — you will be taxed on a smaller gain or will have a larger deductible loss than if the cost basis had not been adjusted.
In addition to the cost basis adjustment, the holding period of the original shares is tacked on to the holding period of the replacement shares. This is significant because it affects whether any future gain or loss on the replacement shares is classified as short-term or long-term. If the original shares were held long enough to qualify for long-term treatment before the wash sale, the holding period clock does not restart from zero when the replacement shares are purchased.
This holding period carry-over can be advantageous for investors who were near the one-year long-term threshold on their original shares, as it means the replacement position may immediately qualify for the preferential long-term capital gains rate.
Deferred Tax Benefit
A common misconception about the wash sale rule is that it destroys your tax loss. In reality, it only defers it. The deferred tax benefit represents the dollar value of the tax savings that will be realized in the future when you ultimately sell the replacement shares at a basis that includes the disallowed loss.
The deferred tax benefit is estimated by multiplying the disallowed loss amount by your marginal tax rate. For instance, if $1,000 of losses are disallowed and your marginal rate is 22%, the deferred benefit is approximately $220. This amount will eventually reduce your tax bill in the year you sell the replacement shares — assuming you do not trigger yet another wash sale at that time.
This deferral has a time value implication: receiving a tax benefit later is generally less valuable than receiving it sooner. The key consideration is how long you will hold the replacement shares before realizing the deferred benefit.
Tax-Loss Harvesting and the Wash Sale Rule
Tax-loss harvesting is a strategy where investors deliberately sell securities at a loss to generate deductions that offset taxable gains elsewhere in their portfolio. The wash sale rule is the primary constraint on this strategy, requiring investors to either wait 31 days before repurchasing the same security or purchase a similar (but not substantially identical) replacement security immediately.
Common approaches to avoid wash sales while staying invested include: purchasing an ETF from a different provider that tracks a comparable but different index, buying individual stocks in the same sector rather than the index fund you sold, or simply waiting the full 31 days before repurchasing the original position if market timing is less of a concern.
Investors with brokerage accounts at multiple institutions should be especially careful, as wash sale rules apply across all accounts — including IRAs and retirement accounts — not just within a single brokerage. Some tax professionals also note that wash sale disallowances involving IRAs may result in a permanent loss of the deduction rather than merely a deferral.
Using This Calculator
Enter the original purchase price per share, the sale price per share, the repurchase price per share, the number of shares involved, and your marginal tax rate. The calculator assumes that a repurchase has already occurred within the 30-day wash sale window, so it calculates the wash sale impact whenever a loss is realized.
If the sale results in a gain rather than a loss, the wash sale rule does not apply regardless of whether a repurchase occurs, and the calculator will reflect that no loss is disallowed. Results are provided for informational purposes only and do not constitute tax advice. Consult a qualified tax professional for guidance specific to your situation.
Frequently Asked Questions
What is the wash sale rule?
The wash sale rule (IRS Section 1091) is a U.S. tax provision that disallows a realized capital loss if you purchase the same or a substantially identical security within 30 days before or after the sale that generated the loss. The disallowed loss is not permanently forfeited — it is added to the cost basis of the repurchased shares, deferring the tax benefit to a future transaction.
Does the wash sale rule apply to gains?
No. The wash sale rule applies only to losses. If you sell a security for a gain and immediately repurchase it, the gain is fully taxable in the year of the sale, but no wash sale disallowance occurs. The rule specifically targets the scenario where an investor sells at a loss and quickly repurchases to maintain market exposure while claiming a tax deduction.
What happens to the disallowed loss?
The disallowed loss is added to the cost basis of the repurchased shares. This higher basis means that when you eventually sell the replacement shares, your taxable gain will be smaller (or your deductible loss will be larger) by the amount of the previously disallowed loss. The tax benefit is deferred, not permanently lost — assuming you eventually sell the replacement shares without triggering another wash sale.
What counts as a 'substantially identical' security?
While not precisely defined by the IRS, 'substantially identical' generally means the exact same stock, bond, or security. Options and warrants on the same underlying stock can also qualify. Two different ETFs tracking similar but distinct indexes are generally not considered substantially identical, which is why some investors swap comparable ETFs during tax-loss harvesting.
Does the wash sale rule apply across different accounts?
Yes. The wash sale rule applies across all accounts you hold, including IRAs, Roth IRAs, and accounts at different brokerages. Wash sales involving a repurchase inside an IRA may result in a permanent loss of the deduction rather than a deferral, because the IRA's tax-advantaged structure prevents the adjusted basis from providing a future deduction.
Related Calculators
Capital Gains Tax Calculator
Calculate tax owed on investment gains, net profit after tax, and effective return.
Donation Tax Benefit Calculator
Estimate the tax benefit of charitable donations based on your marginal tax rate.
Gift Tax Calculator
Estimate gift tax liability based on gift amount, annual exclusion, and applicable tax rate.