Wash Sale Loss Adjustment Calculator

Introduction

The wash sale rule matters most when an investor sells at a loss, wants to stay invested, and quickly buys back the same or a substantially identical security. Economically, nothing may feel very different: you took a loss on one trade and re-entered the market soon after. For tax reporting, however, the timing can change everything. A loss that looks deductible at first glance may be partly or fully deferred, and that deferred amount usually does not vanish. Instead, it is added to the basis of replacement shares and can affect the gain or loss recognized later.

This page is designed to make that logic easier to follow. The calculator estimates the realized loss on the sale, the portion disallowed under the wash sale rule, the amount still allowed in the current year, and the adjusted basis of replacement shares. It is intentionally built around a simple single-lot case so you can understand the mechanics before dealing with more complicated records, multiple tax lots, dividend reinvestments, or overlapping trades across several accounts.

Even in a simplified setting, wash sale calculations are not just bookkeeping trivia. They influence when a tax loss may be used, how much basis carries into the replacement position, and what your future tax result may look like when you eventually dispose of the new shares. If you are tax-loss harvesting, rebalancing, or trying to compare trading strategies, being able to estimate the adjustment quickly is useful.

What is the wash sale rule?

The IRS wash sale rule is designed to prevent taxpayers from claiming an immediate deduction while effectively keeping the same economic position. In general, if you sell a stock, ETF, or other security at a loss and acquire the same or a substantially identical security within the wash sale window, the current deduction is reduced. The wash sale window covers 30 days before the loss sale, the day of the sale itself, and 30 days after it. In other words, it is a 61-day period centered on the sale date.

The practical consequence is important: the disallowed loss is usually deferred rather than erased. In a taxable account, the deferred amount is typically added to the basis of the replacement shares, which means it can reduce a later taxable gain or increase a later loss. Many investors first encounter the rule when they sell a losing position and buy back the same ticker within a few days, but the issue can also arise through automatic investment plans, partial repurchases, or purchases made before the sale date.

This calculator assumes you already know that the sale was at a loss and that the replacement shares you enter are the ones you believe fall inside the wash sale window and are substantially identical for your fact pattern. That is a useful simplification for learning, but real-life classification can be more nuanced, especially with options, mutual fund share classes, index-tracking ETFs, and retirement accounts.

How to use this calculator

Start with the original lot you sold. Enter the number of shares sold, your original basis per share, and the sale price per share. Those three figures establish whether there was a realized loss and how large it was. If the sale price is not below the basis, the tool will show no wash sale loss adjustment because there is no loss to defer.

Next, enter the number of replacement shares repurchased within the wash sale window and the repurchase price per share. In a simple partial wash sale, the number of repurchased shares determines how much of the original loss is deferred. If you sold 100 shares at a loss and bought back 25 matching shares inside the window, then only 25% of the realized loss is generally disallowed in this simplified model. If you bought back all 100 shares, the entire loss may be deferred. If you bought back more shares than you sold, this calculator caps the matched replacement shares at the number sold so the estimate remains grounded in the sold lot.

After you click Calculate, read the results from top to bottom. The first line highlights the disallowed loss, because that is the amount most people are trying to estimate quickly. The remaining lines show the realized loss on the sale, the portion still allowed this year, the adjusted basis per matched replacement share, and the adjusted total basis carried into those replacement shares. That sequence mirrors the way many investors think through the problem: first the economic loss, then the deferred piece, then the basis consequence.

Use the output as an estimate and a learning aid, not as a substitute for the detail on brokerage statements, Form 1099-B, or a tax professional's analysis. In practice, brokers may track wash sales at the account level for covered securities, while a complete taxpayer-level analysis may require reviewing trades across accounts, spouses, dividend reinvestments, and retirement plans. The calculator is still valuable because it helps you understand what each number means before you confront those edge cases.

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 wash sale window, the core values are the realized loss, the matched replacement shares, the disallowed loss, the allowed loss, and the adjusted basis of the replacement shares. This page treats loss as a positive dollar amount for readability. If the sale does not produce a loss, the calculator sets the wash sale adjustment to zero.

Let Qs be the number of shares sold, B the original basis per share, Ps the sale price per share, Qr the replacement shares acquired inside the wash window, and Pr the repurchase price per share. The simplified formulas are:

Realized loss = Qs × ( B Ps ) Matched replacement shares = min ( Qr , Qs ) Disallowed loss = Matched replacement shares Qs × Realized loss Allowed loss = Realized loss Disallowed loss Adjusted basis per matched replacement share = Pr + Disallowed loss Matched replacement shares

Your total adjusted basis in the matched replacement shares is the number of matched replacement shares multiplied by the adjusted basis per matched replacement share. This is the amount of tax basis carried forward into the new position in this simplified scenario.

How to interpret the calculator results

The output is easiest to read as a short story about timing. The realized loss is the economic loss on the sale itself. The disallowed loss is the portion you generally cannot deduct right now because the repurchase occurred too close to the sale. The allowed loss is what remains currently recognizable after the wash sale adjustment. Finally, the adjusted basis tells you how much deferred loss has been embedded in the replacement shares.

A larger disallowed loss does not mean the investment loss disappeared. It usually means the deduction has been pushed forward into the basis of the replacement shares. That future basis adjustment is why the calculator shows both the current-year effect and the carryover effect together. If you later sell the replacement shares, that higher basis can reduce a future taxable gain or increase a future loss.

One subtle point is worth keeping in mind: if only part of the original position is repurchased within the wash window, only that matched portion of the loss is deferred in this simple model. Partial wash sales are common, and understanding the ratio of replacement shares to sold shares is often the fastest way to estimate the disallowed amount.

Worked example of a wash sale adjustment

Suppose you bought 100 shares of XYZ for $50 per share. Later, you sell all 100 shares for $40 per share, which creates a loss. Twelve days after the sale, you buy back 60 shares at $42 per share. Because the repurchase happened inside the wash sale window and we are assuming the shares are substantially identical, part of the original loss is deferred.

The loss per share on the sale is $10, so the total realized loss is $1,000. Only 60 of the 100 sold shares were replaced in the window, so 60% of that loss is disallowed for the current year. That makes the disallowed amount $600 and leaves $400 as the currently allowed loss. The deferred $600 is not lost; it is spread across the 60 replacement shares. Each replacement share therefore carries an additional $10 of deferred basis, turning a $42 repurchase price into a $52 adjusted tax basis per matched replacement share.

This example shows why wash sales can be confusing when investors focus only on the immediate deduction. Economically, you still lost $1,000 when you exited the original position. Tax-wise, only $400 is currently recognized, while $600 is attached to the replacement shares and may matter later.

Comparison: with vs. without the wash sale rule

The contrast below helps illustrate the timing difference. The economic trade outcome is the same, but the timing of the tax deduction changes.

Worked example comparison for a partial wash sale
Item Without wash sale rule With wash sale rule applied
Total realized loss on sale -$1,000 recognized now -$1,000 economic loss, but only partly recognized now
Disallowed loss $0 $600 deferred into basis
Allowed current-year loss -$1,000 -$400
Basis in replacement shares 60 × $42 = $2,520 60 × $52 = $3,120
Future tax impact Lower basis can produce higher future gain Higher basis can reduce future gain or increase future loss

That is the key takeaway: the wash sale rule often changes when a loss is recognized rather than whether an economic loss existed in the first place.

Assumptions, limitations, and important notes

This calculator is intentionally narrow so the mechanics stay clear. It assumes a single lot sold at a loss and a straightforward set of replacement shares entered by the user. It does not attempt to identify which securities are substantially identical, track multiple overlapping purchase lots, or allocate basis among several replacement lots bought at different times. Those situations can require more detailed lot accounting than a simple web calculator should guess.

It also assumes a taxable-account style basis adjustment. Retirement-account wash sales can be especially problematic because, in some cases, the loss may be permanently disallowed rather than added to the basis in the usual way. State rules, broker reporting practices, and updated IRS guidance can also affect how a real return is prepared.

Finally, remember that date classification matters just as much as price data. A repurchase 35 days after the sale is outside the standard wash sale window, while one 12 days before the sale can still count. If you are actively tax-loss harvesting near month-end or year-end, review the trade dates carefully rather than relying on memory.

Trade details

Enter the number of shares in the lot you sold.

This is your basis per share before the sale.

If this is not below basis, there is no realized loss for wash sale purposes.

Count only shares you believe are substantially identical and acquired within 30 days before or after the loss sale.

Used to estimate the adjusted basis of the matched replacement shares.

Mini-game: Wash Window Patrol

This optional mini-game turns the wash sale rule into a fast filing challenge. Imagine that you already sold a losing position on day 0. Incoming trade tickets now need to be routed correctly: send only BUY + SAME + inside ±30 days to Defer. Everything else belongs in Allow. It is a quick way to build intuition for the date window and the idea that only certain replacement purchases defer the loss.

Score0
Time75
Streak0
Lives3
Wave1

Wash Window Patrol

A loss sale already happened on day 0. Sort each ticket before it reaches the filing gate. Choose Allow for safe tickets and Defer only for substantially identical buys inside the ±30-day wash window.

  • Tap or click the left half of the game, or press , for Allow now.
  • Tap or click the right half of the game, or press , for Defer to basis.
  • Build streaks for bonus points. Misses or wrong calls cost a life.

Best score: 0

Educational shortcut: in this simplified game, only an identical buy inside the ±30-day window is filed as a wash-sale deferral.

Disclaimer: This calculator and mini-game provide educational estimates only. They do not constitute tax, legal, or investment advice. Wash sale treatment can depend on facts that this simplified tool does not evaluate, including substantially identical determinations, multiple lots, activity across accounts, and retirement-account purchases. Consult current IRS guidance and a qualified tax professional for your specific situation.

Embed this calculator

Copy and paste the HTML below to add the Wash Sale Loss Adjustment Calculator | Disallowed Loss & Adjusted Basis to your website.