IRS Wash Sale Rule explained: 61-day window, cost basis and tax harvesting

Understand the IRS 61-day wash sale rule, how disallowed losses adjust cost basis, holding period tacking, and how to harvest tax losses safely.

Wash Sale Calculator Stock Profit Calculator

Tax-loss harvesting is one of the most powerful strategies available to stock and options traders: by intentionally realizing losses before year-end, you can offset up to $3,000 of ordinary income and unlimited capital gains.

However, if you buy back the stock too quickly, the IRS Wash Sale Rule disallows your deduction for the current tax year.

Here is how the 61-day window works, how the disallowed loss adjusts your replacement share cost basis, and how to harvest losses safely.

What is the IRS Wash Sale Rule?

Under Section 1091 of the Internal Revenue Code, a wash sale occurs when an investor sells a stock, ETF, or option at a loss, and within 30 days before or 30 days after that sale, purchases:

  1. Substantially identical stock or securities.
  2. A contract or option to acquire substantially identical stock or securities (such as call options).

The rule prevents taxpayers from claiming paper tax deductions without genuinely divesting their economic risk in the position.

The 61-Day Wash Sale Window

Many traders assume the wash sale restriction is only 30 days. In reality, it is a 61-day span:

  • 30 Days Before: If you bought additional shares within 30 days prior to selling your existing shares at a loss, a wash sale is triggered.
  • The Sale Date: The date you sell the lot at a loss.
  • 30 Days After: If you repurchase replacement shares within 30 days following the sale date, the loss is disallowed.

To accurately visualize your 61-day calendar dates and calculate the exact cost basis adjustments, use our free Wash Sale Rule Planner.

Wash Sale Rule PlannerIRS 61-day wash sale window planner for tax loss harvesting, disallowed loss calculations, and replacement basis adjustments.Calculate 61-Day Wash Sale Window

Step-by-Step Example: Cost Basis Adjustment

A common misconception is that a disallowed wash sale loss is “lost money.” In a standard taxable brokerage account, the loss is deferred, not destroyed.

Let’s look at a concrete example:

  1. Trade 1: On March 1, you buy 100 shares of XYZ Corp at $100/share ($10,000 total).
  2. Trade 2: On July 1, the stock has dropped to $70/share. You sell all 100 shares, taking a $3,000 loss.
  3. Trade 3: On July 15 (14 days later, inside the 30-day window), XYZ drops to $65/share. You buy 100 replacement shares for $6,500.

The Tax Outcome:

  • Your $3,000 loss is disallowed for your current tax return.
  • That $3,000 disallowed loss is added directly to the cost basis of your 100 replacement shares:
    • Adjusted Cost Basis = $6,500 + $3,000 = $9,500 ($95/share)
  • Even though you bought the replacement shares at $65, for IRS tax purposes your cost basis is now $95/share.
  • When you later sell XYZ at $110/share, your taxable capital gain will be based on $95/share ($1,500 gain), rather than $65/share ($4,500 gain).

Holding Period Tacking

When a wash sale occurs, the holding period of your original shares is tacked onto the holding period of your new shares.

If you held the original lot for 8 months before selling at a loss, your replacement lot inherits those 8 months. You only need to hold the replacement shares for 4 more months to qualify for lower long-term capital gains tax rates (over 1 year).

How to Harvest Tax Losses Without Triggering a Wash Sale

To legally harvest tax deductions while keeping market exposure:

  1. Use Correlated But Non-Identical ETFs: If you hold an S&P 500 index fund (like SPY or VOO) at a loss, sell it and immediately purchase a Total US Stock Market fund (VTI) or Russell 1000 fund (IWB). They move almost identically, but are not “substantially identical” under IRS guidance.
  2. Wait 31 Full Days: Wait at least 31 calendar days after your sale date before repurchasing the exact ticker.
  3. Double-Up and Wait: If you believe the stock is about to rebound, buy your new shares first, wait 31 days, and then sell the original lot at a loss.
  4. Track Ongoing Positions: Use our Stock Average Price Calculator to manage multiple DCA tranches, and calculate net realized gains with our Stock Profit Calculator before submitting Schedule D.

Tools used in this guide

Free, and they run in your browser — nothing is uploaded. See every tool on the Stock Calculators page.

Frequently asked questions

What is the exact 61-day wash sale timeline?

The wash sale rule applies across a 61-day window: the 30 calendar days before the sale date, the exact date of the sale at a loss, and the 30 calendar days after the sale date.

What happens to the loss that is disallowed by the IRS?

In taxable brokerage accounts, the disallowed dollar loss is not forfeited. Instead, it is added to the cost basis of the replacement shares you purchased. When you eventually sell those replacement shares, your higher cost basis reduces your taxable capital gain.

Does the wash sale rule apply across different brokerages?

Yes. The IRS applies the wash sale rule to the taxpayer, not individual brokerage accounts. If you sell Apple stock at a loss on Charles Schwab and buy Apple stock back on Robinhood within 30 days, you have triggered a wash sale that you must self-report on IRS Form 8949.

Can I trigger a wash sale by trading in an IRA?

Yes, and the consequences are severe. Under IRS Revenue Ruling 2008-5, if you sell stock at a loss in a taxable account and buy substantially identical shares inside a Traditional or Roth IRA within 30 days, the loss is permanently disallowed and cannot be added to your IRA basis.

What qualifies as 'substantially identical' stock or securities?

Common stock and call options on the same underlying company are substantially identical. For ETFs, selling an S&P 500 ETF (SPY) and purchasing another S&P 500 ETF (VOO) is widely considered substantially identical, whereas swapping an S&P 500 fund for a Total Stock Market index fund (VTI) is standard tax-loss harvesting practice.