Dollar figures in this piece are for tax year 2026.

Sell a stock or fund at a loss, then buy substantially identical shares within 30 days before or after, and the loss is disallowed for that year. That is a 61-day window, and it covers purchases in an IRA and by your spouse. Tax-loss harvesting means selling losers to offset gains. The wash-sale rule is what trips people up. It usually postpones the loss, because the disallowed amount moves into the basis of the new shares. It erases the loss only when the replacement shares go into an IRA.

It is October 4, 2026, so a harvest that counts for 2026 still has time. The 30-day window after a December sale runs into January, though. This page covers the rule, the $3,000 limit and carryover, one computed example, and what to check before you click sell. For the broader year-end picture, see the year-end tax planning checklist.

The wash-sale rule in plain terms

Section 1091 allows no deduction for a loss on a sale of stock or securities if, within 30 days before or after the sale, you acquired substantially identical stock or securities, or entered into a contract or option to acquire them. A purchase triggers it, and so does a fully taxable exchange. Pub. 550 lists the same triggers and adds that stock acquired for your IRA or Roth IRA counts.

Count by calendar date. A sale on December 10, 2026 puts the window at November 10, 2026 through January 9, 2027, so the first clean day to buy back is January 10, 2027. Shares bought in the 30 days before the sale count too. That catches automatic dividend reinvestment and a purchase made a few weeks earlier.

The rule follows securities, not accounts. Sell in a taxable account at a loss while your spouse, or a corporation you control, buys the same stock, and you have a wash sale. Sell in taxable and buy in your IRA, and you have one as well. The Code says more than Pub. 550 does about options and short sales: rules similar to subsection (a) apply to a loss on closing a short sale, and contracts or options to acquire stock are treated as stock or securities.

What happens to the disallowed loss

A wash sale usually defers the loss rather than killing it. Under section 1091(d), the basis of the replacement shares is the basis of the shares you sold, adjusted by the difference between the price you paid for the replacement and the price you sold the old shares for. In simple terms, you add the disallowed loss to the cost of the new shares. Under section 1223(3), the old shares' holding period is added to the new ones, so a long-term position stays long-term.

The IRA is the exception. Pub. 550 says to add the disallowed loss to the cost of the new stock except where the replacement was acquired for your IRA or Roth IRA. In that case there is no basis step-up in your taxable account, and the sources I checked give no way to recover it. Of the ways to trip the rule, this one costs the most.

Buy back fewer shares than you sold and only the matched shares are disallowed. The regulation matches replacement shares to the shares sold in the order they were acquired, earliest first. The Pub. 550 (2025) example has a $1,000 loss on 100 shares with 75 replacement shares bought, so $750 is disallowed and $250 is deductible.

The 61-day wash-sale window around a sale
  1. 1-30 daysNov 10: window opens
  2. 20 daysDec 10: you sell at a loss
  3. 321 daysDec 31: tax year ends
  4. 430 daysJan 9, 2027: window closes
  5. 531 daysJan 10: first clean day to rebuy

Any purchase of substantially identical securities from day -30 through day +30 triggers the rule. Example dates are for a December 10, 2026 sale.

Worked example

Example, hypothetical: harvesting against gains

Take a single filer in 2026 with a taxable brokerage account. So far the account has realized an $18,000 long-term gain and a $4,000 short-term gain. The filer holds a fund bought in 2024 with an unrealized long-term loss of $22,000 and sells it in December. For illustration only, assume a 15% rate on long-term gain and 24% on short-term gain. Those are not this person's actual rates.

Without the sale, tax on the gains is $2,700 plus $960, or $3,660. With the $22,000 loss, the long-term side nets to a $4,000 loss, which then offsets the $4,000 short-term gain. Net gains are zero, so the tax is zero. Harvest only $10,000 of loss instead and you are left with $8,000 of long-term gain and $4,000 of short-term gain, tax of $2,160, a saving of $1,500.

Two cautions on that saving. It is a deferral: the replacement fund's basis is its new, lower purchase price, so more gain shows up when it is eventually sold. And the replacement must not be substantially identical, or the whole $22,000 is disallowed for 2026.

Tax on realized gains by amount harvested, 2026 example
Tax on realized gains by amount harvested, 2026 example
Tax on gains (assumed 15% long-term, 24% short-term)
No harvest$3,660
$10,000 harvested$2,160
$22,000 harvested$0

Each dollar of loss offsets a dollar of gain first, so tax falls to zero once $22,000 of loss is harvested.

Computed: $18,000 long-term and $4,000 short-term gain, hypothetical inputs and assumed rates

When losses exceed gains: $3,000 and the carryover

Capital losses offset capital gains first. If losses are larger, section 1211(b) lets an individual deduct the lower of $3,000 ($1,500 if married filing separately) or the excess of losses over gains against other income. Pub. 550 says that deduction is limited to the lesser of that amount or your total net loss.

Whatever is left carries to the next year under section 1212(b) and keeps its character. A net long-term loss comes forward as long-term, a net short-term loss as short-term. Pub. 550 sends you to its carryover worksheet.

Run the same example with a $30,000 loss. Net gains of $22,000 minus $30,000 leave a net loss of $8,000. The filer deducts $3,000 against other income and carries $5,000 forward. At an assumed 24% ordinary rate, the $3,000 deduction is worth $720. So harvesting far more loss than you have gains is rarely about the current year. Harvesting in a year when the zero-rate threshold already covers your gains may not help at all. For 2026, the maximum zero rate amount is $49,450 for single filers and $98,900 for joint filers, per Rev. Proc. 2025-32.

The brokerage words, in plain English

What you readWhat it means
Wash saleA loss sale followed by buying substantially identical securities inside the 61-day window
Substantially identicalNot defined in the Code. Different companies are generally different securities; funds tracking one index are a judgment call
BasisWhat the shares cost you, adjusted. A disallowed loss is added to the new shares' basis
Holding periodHow long you held the shares. It carries over to the replacement shares
CarryoverNet loss beyond the $3,000 limit that moves to the next year as short-term or long-term
1099-B, box 1gWhere the broker reports a wash-sale loss it disallowed. Your spouse's or IRA's purchases you track yourself

Wash sale or not: common situations

Based on Code section 1091 and Pub. 550 (2025). Anything marked judgment depends on the facts.
SituationWash sale?What happens
Sell at a loss, rebuy the same stock on day 20YesLoss disallowed, added to the new shares' basis
Buy the same stock 10 days before selling the old lot at a lossYesWindow runs 30 days before the sale too
Spouse buys the same stock in their own accountYesPub. 550 treats it as a wash sale
Rebuy the same stock in your IRA or Roth IRAYesLoss disallowed, no basis step-up in the IRA
Rebuy on day 31NoLoss allowed for the year of the sale
Swap into a different company or a different index fundJudgmentTurns on whether the new holding is substantially identical
Sell at a gain, buy back the same dayNoThe rule applies only to losses

Choosing a replacement without tripping the rule

The Code does not define "substantially identical", and I have no rule to give you beyond that. Selling one company's stock and buying a different company's is generally a different security. Two funds tracking the same index are a closer call, and options or contracts on the same stock are covered by the statute. If you want to stay invested while you wait 31 days, ask before you trade, not after the 1099-B arrives.

Pub. 550 says Form 1099-B, box 1g shows the wash-sale loss disallowed in certain cases. A purchase in your spouse's account or your IRA is something you have to track yourself. Dividends reinvested into a fund you just sold at a loss count as an acquisition inside the window like any other.

Common mistakes

  • Selling at a loss in December and buying the same security in January, inside the 30-day window.
  • Letting dividend reinvestment buy shares of a fund within 30 days of a loss sale.
  • Buying the same stock in an IRA or Roth IRA, which makes the loss permanently non-deductible in the taxable account.
  • Forgetting that a spouse's purchase counts.
  • Harvesting losses beyond your gains plus $3,000 without a plan to use the carryover.
  • Assuming the broker's statement catches every wash sale, including purchases in other accounts.
  • Overlooking that harvested losses lower the replacement's basis, so the gain returns later.

The usual way versus doing it right

The usual

Sell, then rebuy

  1. Sell at a loss and buy the same fund back in January
  2. Let dividend reinvestment keep buying
  3. Check only the account you sold from
Done right

Check the 61 days first

  1. Look 30 days back and forward in every account, IRAs included
  2. Choose a replacement that is not substantially identical, or wait 31 days
  3. Put your statements and your spouse's side by side

What to do before year-end

  1. List the gains so far

    Add realized short-term and long-term gains for 2026 from every account, including mutual fund capital gain distributions you expect in December.

  2. Pick the lots

    Identify the lots with unrealized losses and note each purchase date. The holding period decides whether the loss is short-term or long-term.

  3. Check the 61 days

    Look 30 days back and forward in every account you and your spouse own, IRAs included, for substantially identical securities and automatic reinvestment.

  4. Choose a replacement

    If you want to stay invested, pick a holding you are confident is not substantially identical, or wait 31 days.

  5. Sell in time

    Make the sale on or before December 31, 2026, and keep the carryover figure for your 2027 return.

  6. Plan the next year

    If the net loss will exceed $3,000, note the carryover and the year you expect gains to absorb it.

Stock compensation or a concentrated position adds moving parts to harvesting. That is part of tax planning, and equity pay is covered on the equity compensation page. For the rate side, read about how capital gains stack on your other income.