How To Calculate Wash Sale

How to Calculate Wash Sale: Interactive Calculator

Use this premium calculator to estimate whether a loss is disallowed under the U.S. wash sale rule, how much loss remains deductible now, and how much basis is added to replacement shares.

Enter your values and click Calculate Wash Sale.

Educational tool only. Final tax reporting should be validated with your broker records and tax professional.

How to Calculate Wash Sale Correctly: Expert Guide

If you sell a stock or ETF at a loss and buy the same or a substantially identical security around the same time, the IRS wash sale rule can delay your tax deduction. Many investors discover this only after receiving a year-end 1099-B with disallowed losses they did not expect. Knowing how to calculate a wash sale in advance helps you plan exits, re-entries, tax-loss harvesting, and year-end portfolio cleanup.

At a high level, a wash sale happens when you realize a capital loss and acquire substantially identical shares within the 61-day window: 30 days before the sale, the sale date, and 30 days after. The loss tied to the replacement shares becomes disallowed for now. In most taxable-account cases, that disallowed amount is added to the cost basis of replacement shares, preserving the loss for future recognition when those replacement shares are eventually sold.

Core wash sale formula

Use this sequence to calculate the impact:

  1. Compute total realized loss: (Sale price per share – Original basis per share) × Shares sold.
  2. Confirm the transaction is a loss: no wash sale applies to gains.
  3. Determine matched replacement shares: the lesser of shares sold at loss and replacement shares bought in-window.
  4. Disallowed loss: Absolute total loss × (Matched shares ÷ Shares sold).
  5. Currently allowed loss: Absolute total loss – Disallowed loss.
  6. Basis adjustment (taxable account): add disallowed loss to replacement shares’ basis.

That proportional approach is essential because wash sales are often partial. If you sold 100 shares at a loss but replaced only 40 in-window, only 40% of the loss is deferred.

Step-by-step numeric example

Suppose you bought 100 shares at $50 and sold them at $40. Your loss is $10 per share, or $1,000 total. Ten days later, you buy 60 replacement shares of the same stock at $42.

  • Total loss = $1,000
  • Matched shares = 60 (the lesser of 100 sold and 60 replaced)
  • Disallowed loss = $1,000 × (60/100) = $600
  • Allowed now = $1,000 – $600 = $400
  • Basis adjustment to replacement shares = +$600 total
  • Per matched replacement share adjustment = $600 / 60 = $10
  • Adjusted basis of matched replacement shares = $42 + $10 = $52

This means you do not lose the deduction forever in a taxable account. Instead, you postpone recognition by increasing replacement basis, which typically reduces future taxable gain or increases future loss.

What counts as “substantially identical”

The IRS wash sale rule under Internal Revenue Code Section 1091 uses the phrase “substantially identical,” which is fact-dependent. Selling and buying the exact same ticker is clearly covered. Selling one issuer’s common stock and rebuying that same issuer’s common stock through options or automatic reinvestment can also trigger issues. Similar sector ETFs are often not identical, but this can be nuanced. When planning large tax-loss harvesting trades, review fund methodology, index overlap, and issuer differences carefully.

Common triggers investors miss

  • Dividend reinvestment (DRIP): automatic share purchases in-window can create partial wash sales.
  • Spousal accounts: replacement trades in certain related contexts can affect results.
  • Multiple brokerage accounts: one account may sell at a loss while another account repurchases.
  • IRA repurchase: disallowed loss can become permanently nondeductible rather than basis-adjusted in taxable shares.
  • Options and conversions: derivatives can create substantially identical exposure.

2024 federal tax context that makes wash sale planning important

Wash sale calculations matter because the timing of capital loss recognition can change your near-term tax bill. If your short-term gains are high and you expected a large offset from tax-loss harvesting, deferred losses reduce that immediate benefit. The following table shows official 2024 long-term capital gains thresholds from IRS inflation-adjusted values, which helps frame tax consequences when gains are eventually recognized.

Filing Status (2024) 0% LTCG Rate Up To 15% LTCG Rate Up To 20% LTCG Rate Above
Single $47,025 $518,900 $518,900
Married Filing Jointly $94,050 $583,750 $583,750
Head of Household $63,000 $551,350 $551,350

Short-term gains are taxed at ordinary income rates, so deferring losses can be even more expensive in high-bracket years. Here is a compact 2024 single-filer ordinary income bracket reference.

2024 Tax Bracket (Single) Taxable Income Range
10%$0 to $11,600
12%$11,601 to $47,150
22%$47,151 to $100,525
24%$100,526 to $191,950
32%$191,951 to $243,725
35%$243,726 to $609,350
37%Over $609,350

Authoritative references you should review

For formal rules, examples, and recordkeeping standards, review these primary sources:

How this calculator handles wash sale math

This calculator applies a practical method used by many tax workflows:

  1. Read your sold shares, original basis, and sale price.
  2. Calculate gross gain or loss.
  3. If result is a gain or break-even, wash sale disallowance is zero.
  4. If loss and replacement timing is inside the wash window, match replacement shares proportionally.
  5. Allocate disallowed loss to replacement basis for taxable accounts.
  6. If replacement is in an IRA selection, it flags that deferred loss may be permanently nondeductible.

While brokers provide wash sale reporting for covered shares in many situations, your complete tax result can require combining data across accounts and firms. This is why independent calculation is valuable before year-end and before placing replacement trades.

Partial wash sale scenarios

Partial matching is the most common source of confusion. If your replacement share count is lower than your sold share count, only that proportion is disallowed. If replacement count exceeds sold shares, disallowance is capped at the loss-linked sold shares. For active traders with multiple lots, matching can become lot-specific and sequence-sensitive. In real bookkeeping, the disallowed loss is attached to specific replacement lots and affects holding period treatment as well.

Timing rules and practical calendar guidance

The 61-day period includes the sale date itself. If you sold on June 15, in-window purchases are from May 16 through July 15. Year-end transitions are critical: a December loss sale can still be washed out by January purchases. Many investors mistakenly assume a new tax year resets wash-sale exposure immediately, but the calendar year does not override the 30-day-after rule.

Tax-loss harvesting without accidental wash sales

If your goal is immediate loss recognition, common techniques include:

  • Wait more than 30 days before repurchasing the same security.
  • Use a non-identical substitute investment during the waiting period.
  • Turn off dividend reinvestment on positions you may sell for losses.
  • Coordinate all household accounts before executing replacement trades.
  • Document lots and dates immediately, not months later at tax time.

Tax-loss harvesting is a portfolio process, not a single trade. The wash sale rule is one of the biggest reasons a theoretically tax-efficient strategy may underdeliver in practice if execution details are sloppy.

What about crypto?

Under current federal rules, wash sale treatment as written in Section 1091 applies to stocks and securities. Many practitioners note that spot crypto has historically not been explicitly covered the same way, though law changes are always possible and interpretations can evolve. Always confirm current-year guidance and legislation before relying on assumptions.

Recordkeeping checklist

  1. Trade confirmations with execution date/time.
  2. Lot-level basis history and adjustments.
  3. Account-level mapping of replacement buys.
  4. DRIP activity logs for affected symbols.
  5. Broker 1099-B details and reconciliation notes.
  6. Cross-account spreadsheet showing 61-day windows.

Good records transform wash sale analysis from guesswork into exact math. If you run multiple strategies, this also reduces surprises when preparing Schedule D and Form 8949.

Final takeaway

To calculate a wash sale, think in three layers: the realized loss, the in-window matched shares, and the basis carryover effect. The loss is not always gone, but it may be delayed, and in IRA-related cases, potentially lost for deduction purposes. If you are managing meaningful gains, use a pre-trade checklist and a lot-aware calculator like the one above before placing replacement orders. That single habit can protect tax alpha and improve after-tax portfolio performance.

Leave a Reply

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