Wash Sale Loss Adjustment Calculator

JJ Ben-Joseph headshot JJ Ben-Joseph

What is the wash sale rule?

The IRS wash sale rule is designed to prevent investors from creating artificial tax losses. If you sell a stock, ETF, or other security at a loss and buy the same or a substantially identical security within 30 days before or after the sale, the loss is generally disallowed for current tax purposes. Instead, the disallowed loss is added to the cost basis of the new shares.

This calculator is intended to help you estimate two key values in a simple, single-lot scenario:

  • Disallowed loss under the wash sale rule
  • Adjusted cost basis of the replacement shares

Always confirm your calculations against IRS guidance and, where appropriate, with a qualified tax professional before filing a return.

Core formulas used in wash-sale loss adjustment

For a basic case where you sell a single lot of shares at a loss and repurchase some or all of those shares within the 61-day window (30 days before, the day of sale, and 30 days after), the key concepts are:

  • Realized loss: the total dollar loss on the sale.
  • Disallowed loss: the portion of that loss that cannot be deducted currently because of the wash sale rule.
  • Allowed loss: any remaining loss that can still be claimed this year.
  • Adjusted basis: the new tax basis of your replacement shares after adding the disallowed loss.

Let:

  • Qs = number of shares sold
  • B = original cost basis per share
  • Ps = sale price per share
  • Qr = number of shares repurchased within the wash sale window
  • Pr = repurchase price per share

Then the core formulas are:

Realized\ Loss = Qs ร— ( Ps โˆ’ B ) Disallowed\ Loss = Qr Qs ร— Realized\ Loss Allowed\ Loss = Realized\ Loss โˆ’ Disallowed\ Loss Adjusted\ Basis\ per\ Replacement\ Share = Pr + Disallowed\ Loss Qr

Your total adjusted basis in the replacement shares is:

Adjusted total basis = Qr ร— Adjusted basis per replacement share

How to interpret the calculator results

When you run the wash sale loss adjustment calculator, you will typically see outputs similar to:

  • Total realized loss on sale โ€“ the dollar loss before applying the wash sale rule.
  • Disallowed loss (wash sale) โ€“ the portion of that loss that cannot be deducted this year and is instead rolled into the new basis.
  • Allowed current-year loss โ€“ the part of the loss you may be able to claim now, subject to other tax rules.
  • Adjusted basis of replacement shares โ€“ the new cost basis that will affect your gain or loss when you later dispose of the replacement shares.

Higher disallowed losses mean you will usually have a smaller current deduction but a higher basis going forward, which can reduce future taxable gains or increase future losses when you sell the replacement shares.

Worked example of a wash sale adjustment

Suppose you have the following situation:

  • You bought 100 shares of XYZ at an original basis of $50 per share.
  • You sell all 100 shares for $40 per share, realizing a loss.
  • Within 30 days after the sale, you buy back 60 shares at $42 per share.

Step 1: Calculate realized loss on the sale.

  • Loss per share = $40 โˆ’ $50 = โˆ’$10
  • Total realized loss = 100 ร— (โˆ’$10) = โˆ’$1,000

Step 2: Determine the disallowed loss.

  • Shares repurchased within window: 60
  • Shares sold: 100
  • Disallowed loss = (60 / 100) ร— $1,000 = $600

Step 3: Allowed loss this year.

  • Allowed loss = $1,000 โˆ’ $600 = $400

Step 4: Adjust basis of replacement shares.

  • Repurchase price per share = $42
  • Disallowed loss per replacement share = $600 / 60 = $10
  • Adjusted basis per replacement share = $42 + $10 = $52
  • Total adjusted basis in 60 replacement shares = 60 ร— $52 = $3,120

When you later sell the 60 replacement shares, you will use $52 per share as your cost basis for gain/loss calculations, reflecting the deferred portion of the original loss.

Comparison: with vs. without the wash sale rule

The table below contrasts how the same transaction looks with and without the wash sale rule, using the worked example above.

Item Without wash sale rule With wash sale rule applied
Total realized loss on sale โˆ’$1,000 (fully deductible now) โˆ’$1,000 (economic loss is the same)
Disallowed loss $0 $600 disallowed currently
Allowed current-year loss โˆ’$1,000 โˆ’$400
Basis in replacement shares 60 ร— $42 = $2,520 60 ร— $52 = $3,120 (includes deferred loss)
Future tax impact Higher gain / smaller loss when you sell the 60 shares Lower gain / larger loss when you sell the 60 shares

This illustrates that the wash sale rule does not make the loss disappear. Instead, it delays the deduction by embedding the disallowed portion into the basis of your replacement shares.

Assumptions, limitations, and important notes

  • U.S. federal rules focus: This explanation assumes U.S. federal income tax treatment. State and local rules may differ.
  • Simple single-lot scenario: The discussion here assumes one sale lot and a straightforward repurchase. Multiple overlapping lots, automatic dividend reinvestments, and frequent trading can make wash-sale tracking more complex.
  • Substantially identical securities: Determining whether two securities are "substantially identical" can be fact-specific. Common issues include mutual fund share classes, options, and certain ETFs tracking similar indexes.
  • Retirement accounts: Special complications can arise if you sell in a taxable account and repurchase in an IRA or other tax-advantaged account. Some losses may be permanently disallowed rather than deferred into basis.
  • No automatic IRS updates: Tax laws, regulations, and IRS interpretations can change. Always check current IRS publications, such as Publication 550 (Investment Income and Expenses), for up-to-date guidance.
  • Educational tool only: Any calculator using these concepts should be viewed as an educational aid, not a substitute for professional tax advice or detailed record-keeping from your broker.

Disclaimer: This explanation is for general informational purposes only and does not constitute tax, legal, or investment advice. Your specific situation may involve additional rules or exceptions. Consult a qualified tax professional or financial advisor before making decisions that affect your tax filings.

Using this calculator effectively

For the most useful results, gather the following information before using a wash sale loss adjustment calculator:

  • Number of shares sold, original cost basis per share, and sale price per share.
  • Number of shares repurchased within 30 days before or after the sale, and the repurchase price per share.
  • The relevant trade dates so you can confirm that repurchases fall inside the wash sale window.

Enter consistent, accurate numbers, then review both the dollar amounts and the narrative explanation of the outputs. When in doubt, compare the results with your brokerโ€™s tax documents or seek professional guidance.

Disclaimer: This calculator provides educational estimates only and does not constitute professional advice. Consult with qualified professionals for your specific situation.

Embed this calculator

Copy and paste the HTML below to add the Wash Sale Loss Adjustment Calculator to your website.