How To Calculate A Wash Sale

Wash Sale Calculator: How to Calculate a Wash Sale

Estimate disallowed loss, deductible loss, and replacement-share basis adjustment using IRS wash sale timing rules.

How to Calculate a Wash Sale: Complete Expert Guide

If you actively trade stocks, ETFs, options, or mutual funds in taxable accounts, understanding how to calculate a wash sale can save you from painful tax surprises. Many investors learn this rule only after reviewing their year-end 1099-B and seeing losses disallowed. The wash sale rule can defer a tax loss you expected to deduct, but with proper planning you can track it and avoid costly mistakes.

At a high level, a wash sale occurs when you sell a security at a loss and buy the same or a substantially identical security within a specific time window. The IRS generally disallows that immediate loss. Instead, the disallowed loss is added to the basis of replacement shares, and the deduction is deferred until a qualifying future sale. This is why precise calculation matters: your tax outcome changes now and later.

The Core Rule in Plain English

The wash sale timing window is 30 days before the loss sale date, the day of sale, and 30 days after, for a 61-day window. If you buy substantially identical shares in that window, the corresponding loss is disallowed today. You do not lose that loss forever in most standard situations; it is usually shifted into the cost basis of replacement shares.

  • Sell at a loss in a taxable account.
  • Buy substantially identical shares within 30 days before or after the sale date.
  • Loss becomes disallowed to the extent matched by replacement shares.
  • Disallowed amount is added to replacement-share basis.
Official references: IRS Publication 550 and IRS Code Section 1091 are foundational resources for this rule. Use them when validating edge cases with a tax professional.

Step-by-Step Formula to Calculate a Wash Sale

The most practical method is to compute the realized loss first, then determine how many shares are subject to wash treatment, and finally split the loss into disallowed versus currently deductible amounts.

  1. Calculate total basis of sold shares: Shares sold multiplied by original cost per share.
  2. Calculate sale proceeds: Shares sold multiplied by sale price per share.
  3. Calculate realized loss: Total basis minus sale proceeds (if positive).
  4. Find wash-sale shares: Minimum of shares sold at loss and replacement shares purchased in the 61-day window.
  5. Calculate loss per share: Realized loss divided by shares sold at loss.
  6. Calculate disallowed loss: Wash-sale shares multiplied by loss per share.
  7. Calculate currently deductible loss: Realized loss minus disallowed loss.
  8. Adjust replacement basis: Add disallowed loss to replacement shares that triggered wash treatment.

Example: You sell 100 shares bought at $50 for $40, creating a $1,000 realized loss. If you repurchase 60 substantially identical shares inside the window, then 60 percent of the loss is disallowed. Your disallowed loss is $600, and your currently deductible loss is $400. The $600 is added to the basis of the 60 replacement shares.

Comparison Table: Key Wash Sale Numbers Investors Must Track

Metric Value Why It Matters
Wash sale window 61 days total Includes 30 days before sale, sale day, and 30 days after sale.
Maximum loss disallowed Up to 100% If replacement shares fully match loss-sale shares, all loss can be deferred.
Capital gain rates (long term) 0%, 15%, 20% Deferred losses affect future gains taxed at applicable federal rates.
Net investment income tax 3.8% High-income taxpayers may face additional tax impact when losses are deferred.
Settlement cycle for most U.S. equities T+1 Faster settlement can increase trade frequency and lot complexity in records.

What Counts as “Substantially Identical”

This phrase causes the most confusion. Identical shares of the same company are straightforward. More difficult cases include share classes, options, convertible instruments, and near-duplicate funds. The IRS has not created a single universal list for every ETF pair or fund pair, so investors should apply conservative judgment.

  • Same stock ticker bought back quickly: very likely substantially identical.
  • Call options deep in the money on the same stock: potentially substantially identical.
  • Different broad-market ETFs from different issuers: sometimes argued as different, but facts matter.
  • Mutual fund to near-clone mutual fund tracking identical index: elevated risk.

A best practice is to rotate into a similar but not materially identical exposure when harvesting losses. For example, some investors temporarily move from one index product to another with a different benchmark methodology. Always review the fund strategy, holdings overlap, and index design before assuming it is safe.

Comparison Table: Tax Character and Planning Impact

Situation Immediate Tax Effect Long-Term Effect
Loss sale with no replacement purchase in 61 days Loss generally deductible under capital-loss rules Lower current-year taxable gains or up to annual net capital-loss deduction limits
Partial replacement purchase in window Portion of loss disallowed Disallowed amount increases replacement-share basis proportionally
Full replacement purchase in window Entire loss can be disallowed in current year Loss deferred and recognized when adjusted replacement shares are eventually sold
Gain sale (not a loss) No wash sale disallowance applies Gain remains taxable according to holding period and tax bracket

Frequent Real-World Mistakes

Many wash sale issues come from account structure, not just one trade. Investors may sell in a taxable brokerage account and unknowingly repurchase in an IRA, spouse account, or automated reinvestment program. In certain cases, especially across taxable and retirement accounts, recovery of deferred losses can be limited or effectively lost. Coordination matters.

  • Ignoring dividend reinvestment plans that buy small lots inside the window.
  • Forgetting option assignments and exercises can create replacement positions.
  • Harvesting losses late in December while auto-buy plans run in January.
  • Tracking only one broker while trading same ticker across multiple platforms.
  • Assuming broker reporting captures every cross-account or spouse-level scenario.

Advanced Lot Matching and Partial Wash Sales

Partial wash sales are common and often misunderstood. Suppose you sell 500 shares at a loss and repurchase 125 shares in the window. Only 125 shares of loss are disallowed. The rest may remain deductible. If your loss per share is not constant due to mixed tax lots, the correct approach is lot-by-lot accounting. This is where robust records become essential.

You should preserve purchase confirmations, sale confirmations, and any corporate action notices. If a broker’s form differs from your own records, reconcile before filing. Use a consistent basis method and verify lot selection instructions were accepted on trade day. Delays or default settings can change realized loss calculations significantly.

How This Calculator Helps You Model the Rule

The calculator above is designed for quick planning and education. It computes realized loss, identifies whether replacement timing appears inside the wash sale window, and estimates disallowed loss based on replacement-share count. It then shows your currently deductible loss and the basis adjustment that moves into replacement shares.

Use this model before placing replacement trades so you can decide whether to:

  • Wait until the 31st day after sale to re-enter the same ticker.
  • Temporarily use a different exposure to maintain market participation.
  • Reduce replacement share count to limit disallowance.
  • Coordinate household accounts to avoid accidental triggering purchases.

Planning Checklist Before Year End

  1. Export all taxable-account trades and classify gains versus losses.
  2. Identify open buy orders and recurring contributions across every account.
  3. Disable automatic dividend reinvestment temporarily where needed.
  4. Review spouse accounts and managed accounts for overlapping positions.
  5. Track 30-day pre-sale and post-sale periods on a calendar.
  6. Document replacement-lot basis adjustments for future selling decisions.
  7. Confirm 1099-B and your internal records are aligned before filing.

Authoritative Sources for Wash Sale Rules

For official language and up-to-date interpretation, review these resources:

Final Takeaway

Learning how to calculate a wash sale is less about memorizing one equation and more about building a repeatable process. Compute the realized loss, match replacement shares inside the 61-day window, determine disallowed loss, and adjust replacement basis. Then verify records across all relevant accounts. Done correctly, you can harvest losses intentionally, stay invested, and avoid preventable filing errors.

If your situation includes options, short sales, complex fund substitutions, or retirement-account interactions, use this calculator for planning but confirm final treatment with a qualified tax advisor. Precision here can materially affect both current-year tax liability and future gain calculations.

Leave a Reply

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