How Is Wash Sale Calculated

How Is Wash Sale Calculated? Interactive Calculator + Expert Guide

Estimate disallowed loss, currently deductible loss, and replacement share basis adjustment under IRS wash sale rules.

Wash Sale Calculator

Enter your trade details, then click Calculate Wash Sale.

How Is a Wash Sale Calculated? A Practical, Tax Accurate Walkthrough

If you are asking how a wash sale is calculated, you are already ahead of most investors. Many traders focus on buying and selling decisions, but they do not realize that timing and share matching can change how much loss is deductible in the current year. A wash sale does not erase your loss permanently. Instead, it usually defers part or all of that loss by adding it to the basis of replacement shares acquired within the wash sale window.

At a high level, the wash sale rule applies when you sell a security at a loss and buy a substantially identical security within 30 days before or after the sale date. That creates a 61-day window centered on the loss sale date. The disallowed amount depends on how many replacement shares are matched to the loss shares. If all shares are matched, all loss is deferred. If only some are matched, only a proportional part is deferred.

The governing statute is 26 U.S. Code Section 1091, and practical interpretation is discussed in IRS Publication 550. For capital gain and loss treatment context, see IRS Topic No. 409.

The Core Wash Sale Formula

The calculation itself is straightforward once you define the matched share count correctly:

  1. Compute per-share loss: Original basis per share minus sale price per share.
  2. If per-share loss is zero or negative, wash sale does not apply because there is no loss.
  3. Find matched replacement shares: minimum of shares sold at loss and replacement shares bought in window.
  4. Disallowed loss: matched shares multiplied by per-share loss.
  5. Currently deductible loss: total realized loss minus disallowed loss.
  6. Basis adjustment to replacement shares: add disallowed loss to replacement shares basis.

In full wash sales, all shares are matched and the entire realized loss is deferred. In partial wash sales, only a fraction is deferred. This is the point that many investors miss, and it is where a calculator saves time and reduces errors.

Example 1: Full Wash Sale

  • Sold 100 shares at $40
  • Original basis was $50 per share
  • Per-share loss = $10
  • Total realized loss = $1,000
  • Bought 100 replacement shares within the 30-day window

Because all 100 shares are matched, disallowed loss is $1,000 and currently deductible loss is $0. Your replacement basis increases by $1,000 total, usually $10 per matched share.

Example 2: Partial Wash Sale

  • Sold 200 shares at a $6 per-share loss
  • Total realized loss = $1,200
  • Bought only 50 replacement shares in the window
  • Matched shares = 50
  • Disallowed loss = 50 × $6 = $300
  • Currently deductible loss = $900

In partial matching, you still receive a current deduction for the unmatched portion. The disallowed segment moves into replacement basis and is recognized later when those replacement shares are sold in a non-wash transaction.

Tax Rate Context: Why Deferred Loss Timing Matters

Wash sale rules affect timing, and timing affects tax cash flow. A deferred loss means less current year deduction and potentially a higher current tax bill than expected. Even if your economics do not change much over a long horizon, short-term cash flow can be meaningful for active investors.

Filing Status (2024) 0% LTCG Rate up to 15% LTCG Rate 20% LTCG Rate starts above
Single $47,025 $47,026 to $518,900 $518,900
Married Filing Jointly $94,050 $94,051 to $583,750 $583,750
Head of Household $63,000 $63,001 to $551,350 $551,350
Married Filing Separately $47,025 $47,026 to $291,850 $291,850

These are 2024 long-term capital gain thresholds published by the IRS in annual inflation adjustments.

Investors often assume wash sales are only relevant for day traders. In reality, they can affect long-term investors who tax-loss harvest near year-end and re-enter similar positions quickly. The issue can become more frequent during volatile years when portfolios rebalance more often.

Market Year S&P 500 Annual Return Following Year Return Why It Matters for Wash Sale Planning
2008 -37.0% +26.5% (2009) Large losses created heavy tax-loss harvesting activity.
2018 -4.4% +31.5% (2019) Quick rebounds increased chance of re-entry inside wash windows.
2022 -18.1% +26.3% (2023) High volatility increased both realized losses and replacement trades.

Returns shown are commonly cited S&P 500 calendar-year total return figures from major market datasets.

What Counts as Substantially Identical?

The IRS does not provide a single bright line checklist covering every security type. Obvious examples include selling and rebuying the exact same stock or the same CUSIP share class. The gray area is often similar ETFs tracking overlapping indexes. Many investors use alternative funds tracking different indexes to maintain exposure while reducing wash sale risk, but treatment depends on facts and circumstances.

  • Same stock sold and rebought quickly: high wash sale risk.
  • Identical option contracts replacing sold shares: often high risk.
  • Different issuers tracking different indexes: generally lower risk, not guaranteed.
  • Across taxable accounts and spouse accounts: still can trigger wash sales.

Common Calculation Mistakes

  1. Ignoring partial matches: not all replacement trades match all sold shares.
  2. Forgetting pre-sale purchases: buys made 30 days before the loss sale can also trigger the rule.
  3. Checking only one brokerage account: wash sales can occur across accounts.
  4. Missing basis carryover tracking: deferred loss should increase replacement basis.
  5. Assuming no impact in IRAs: transactions involving IRAs may create unfavorable outcomes and lost loss recognition scenarios.

Step by Step Process You Can Use Every Time

  1. Identify each lot sold at a loss and record shares, basis, and sale price.
  2. Review all purchases in the 30 days before and after the sale date.
  3. Determine matched share count lot by lot.
  4. Calculate disallowed loss and currently allowed loss.
  5. Allocate deferred loss to replacement lots and update basis records.
  6. Document holding period adjustments where required.
  7. Reconcile your internal records against broker 1099-B data.

How to Use This Calculator Correctly

Enter shares sold, cost basis per share, sale price, and replacement share information. If you enter both dates, the calculator can automatically evaluate whether trades are inside the 30-day rule window. If your dates are incomplete, choose a timing assumption manually. The tool then computes:

  • Total realized loss
  • Matched shares
  • Disallowed wash sale loss
  • Current deductible loss
  • Adjusted replacement basis
  • Estimated tax deferral impact based on your selected rate

This is intended for planning and education. Your final reporting should rely on complete lot-level records and qualified tax advice when needed.

Advanced Notes for Active Traders

If you trade multiple lots at different prices, the wash sale result can differ from a simple blended average. Lot identification methods, execution timing, and replacement lot sequencing can all affect the disallowed amount. Professional workflows often export all transactions to a tax lot engine that calculates matching at scale. Even then, you should review exception reports because unusual options activity, corporate actions, and symbol changes can complicate matching logic.

Another advanced point is tax alpha management. Deferral is not always bad if you expect future gains where increased basis helps later. But unplanned deferral can reduce near-term tax efficiency and interfere with strategy evaluation. Good tax aware execution focuses on maintaining market exposure while minimizing accidental rule violations.

Bottom Line

The wash sale calculation is fundamentally a share matching exercise tied to a strict date window. Once you know the per-share loss and the number of matched replacement shares, the disallowed amount is mechanical. The key is record quality and process discipline. Use the calculator to estimate impact quickly, then validate against full brokerage data before filing.

Leave a Reply

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