Wash Sale Rule Calculator






Wash Sale Rule Calculator | Calculate Disallowed Losses & Adjusted Basis


Wash Sale Rule Calculator

Calculate Disallowed Tax Losses & Basis Adjustments Automatically


The price you originally paid for the security.
Please enter a valid price.


The price at which you sold the security for a loss.
Sale price must be lower than purchase price to trigger a wash sale.


Total number of shares sold in the loss transaction.


Price of the “substantially identical” security bought within the 61-day window.


Number of shares bought back. If less than sold, only a partial wash sale occurs.


Total Disallowed Loss
$0.00
Adjusted Cost Basis (Per Share)
$0.00
Total Adjusted Cost Basis
$0.00
Realized Loss (Current Year)
$0.00

Formula: Disallowed Loss = (Original Cost – Sale Price) × Min(Shares Sold, Shares Reacquired).
New Basis = Replacement Price + (Disallowed Loss / Shares Reacquired).

Visual Comparison: Cost Basis Impact

Blue: Initial Cost | Green: New Adjusted Basis (deferred loss included)


Wash Sale Summary Table
Metric Original Value Post-Wash Sale Value

What is a Wash Sale Rule Calculator?

A wash sale rule calculator is an essential tool for investors and traders to navigate the complex tax regulations set by the IRS regarding capital losses. The wash sale rule prevents taxpayers from claiming a tax deduction for a security sold at a loss if they purchase a “substantially identical” security within 30 days before or after the sale. Using a wash sale rule calculator helps you determine exactly how much of your loss is “disallowed” for the current tax year and how that loss is added to the cost basis of your new position.

This rule is primarily designed to prevent investors from “tax-loss harvesting” purely for tax benefits while maintaining their market position. If you trigger a wash sale, the loss isn’t gone forever; it is deferred. Our wash sale rule calculator automates the math of shifting that loss into your new shares’ cost basis, ensuring you don’t overpay or underpay your capital gains taxes.

Wash Sale Rule Calculator Formula and Mathematical Explanation

The logic behind the wash sale rule calculator involves several steps to handle both full and partial wash sales. Here is the step-by-step derivation used in our engine:

  1. Calculate Potential Loss: First, we determine the loss per share: Original Purchase Price - Sale Price.
  2. Determine Wash Shares: We identify the number of shares subject to the rule. This is the minimum of (Shares Sold) or (Shares Reacquired).
  3. Calculate Disallowed Loss: Disallowed Amount = Loss Per Share × Wash Shares.
  4. Adjusted Cost Basis: The disallowed loss is added to the cost of the replacement shares. New Basis Per Share = Replacement Price + (Total Disallowed Loss / Shares Reacquired).
Variables in Wash Sale Calculation
Variable Meaning Unit Typical Range
Original Price The initial price paid for the stock Currency ($) $0.01 – $1,000,000
Sale Price The price the stock was sold for at a loss Currency ($) Less than Original Price
Replacement Price Cost of the new “identical” security Currency ($) Market Price
30-Day Window The period before and after the sale Days 61 days total

Practical Examples (Real-World Use Cases)

Example 1: The Simple Wash Sale

An investor buys 100 shares of XYZ Corp at $100. The stock drops to $80, and they sell the entire position. Two days later, they buy back 100 shares at $85. Using the wash sale rule calculator, we see:

  • Original Loss: $2,000 ($20 x 100).
  • Disallowed Loss: $2,000 (Because 100 shares were reacquired).
  • Adjusted Basis: $85 + $20 = $105 per share.

The investor cannot claim the $2,000 loss this year, but their “break-even” price for the new shares is now $105.

Example 2: Partial Wash Sale

Imagine selling 200 shares at a loss of $10 per share, but only buying back 100 shares within the window. The wash sale rule calculator will show that only $1,000 of the loss is disallowed (100 shares), while the remaining $1,000 loss can be claimed as a capital loss on this year’s tax return.

How to Use This Wash Sale Rule Calculator

  1. Enter Original Price: Input the price you paid for the shares you sold at a loss.
  2. Enter Sale Price: Input the price you received when you closed the position.
  3. Set Quantities: Enter how many shares you sold and how many you bought back (replacement).
  4. Enter Replacement Cost: Input the price of the new shares.
  5. Review Results: The wash sale rule calculator updates in real-time. Look at the “Total Disallowed Loss” to see what you cannot claim this year.
  6. Adjust Your Records: Use the “Adjusted Cost Basis” for your future tax filings when you eventually sell the replacement shares.

Key Factors That Affect Wash Sale Rule Results

  • Substantially Identical Securities: The rule applies not just to the same stock, but to options, ETFs that track the same index, or stocks in a merger.
  • The 61-Day Window: The rule counts 30 days *before* the sale, the day of the sale, and 30 days *after* the sale.
  • Account Types: Selling in a taxable account and buying back in an IRA can trigger a wash sale, and the loss may be permanently lost.
  • Quantity Mismatch: If you buy fewer shares than you sold, the wash sale only applies to the number of shares you bought back.
  • Holding Period: The holding period of the original shares is added to the holding period of the replacement shares.
  • Corporate Actions: Stock splits or dividends generally don’t trigger the rule unless they result in the acquisition of new “identical” shares.

Frequently Asked Questions (FAQ)

What happens to a disallowed loss?

A disallowed loss from a wash sale rule calculator result is added to the cost basis of the new shares. You eventually realize the benefit of the loss when you sell those replacement shares in a non-wash-sale transaction.

Does the wash sale rule apply to gains?

No, the IRS only applies the wash sale rule to losses. If you sell at a profit and buy back immediately, you must pay taxes on the gain.

Can I avoid a wash sale by using a different broker?

Technically, brokers only report wash sales within the same account. However, taxpayers are legally required to report wash sales across all their accounts, including IRAs and different brokerages.

Does the rule apply to Cryptocurrency?

Currently, the IRS “wash sale rule” applies to securities. As of the current tax laws, crypto is treated as property, but legislative changes frequently propose extending the wash sale rule to digital assets.

How do I report a wash sale on my taxes?

Wash sales are reported on IRS Form 8949. You list the full loss in one column and use Code “W” to show the disallowed portion in another.

Is a 31-day wait enough?

Yes. If you wait at least 31 days after the sale to buy back the security, the wash sale rule calculator will show zero disallowed loss.

What if I sell the replacement shares before the end of the year?

If you sell the replacement shares and don’t buy them back again within 30 days, the deferred loss is finally “realized” and can be used in that tax year.

Does it apply to ETFs?

Yes, selling one S&P 500 ETF and buying another S&P 500 ETF from a different provider is often considered “substantially identical” by the IRS.

Related Tools and Internal Resources


Leave a Reply

Your email address will not be published. Required fields are marked *