Tax-Loss Harvesting and the Wash Sale Rule Explained

TL;DR. Tax-loss harvesting is the practice of selling investments at a loss to offset capital gains — and up to $3,000 of ordinary income — on your federal return. The catch is the wash sale rule: if you (or your spouse, or your IRA) buy a substantially identical security within 30 days before or after the loss sale, the IRS disallows the loss for that year. This article walks through how harvesting actually saves tax, what triggers a wash sale, and the mistakes that quietly cost investors thousands of dollars at tax time.

What tax-loss harvesting actually does

On your federal tax return, your capital gains and losses for the year are netted against each other before you owe any tax. The order is set by the IRS:

  1. Short-term losses first offset short-term gains (taxed at your ordinary income rate, which can be as high as 37%).
  2. Long-term losses first offset long-term gains (taxed at 0%, 15%, or 20% depending on income — see table below).
  3. If one bucket has leftover losses, they cross over to offset gains in the other bucket.
  4. If you still have a net loss across both buckets, up to $3,000 ($1,500 if married filing separately) reduces your ordinary income for the year. The rest carries forward indefinitely to future tax years (IRS Topic 409).

So the question “does harvesting save me money?” really means: will the loss I recognize today shelter income that would otherwise be taxed at a high rate, while the replacement holding eventually grows back? When the answer is yes, the savings are real and compound for years.

Rate Single filer taxable income Married filing jointly
0% Up to $49,450 Up to $98,900
15% $49,451 – $545,500 $98,901 – $613,700
20% Over $545,500 Over $613,700
Source: IRS Rev. Proc. 2025-32, 2026 inflation adjustments. Short-term gains (held one year or less) are taxed at ordinary income rates instead.

A simple worked example

Suppose you are a single filer in the 32% federal bracket. Earlier this year you closed an options trade at a $10,000 short-term gain. Now one of your stock positions is sitting on a $10,000 unrealized loss after a sector rotation. You have three choices:

  • Do nothing. You owe ordinary tax on the full $10,000 short-term gain. At 32%, that’s $3,200 of federal tax (state tax is on top).
  • Harvest $3,000 of the loss. Net short-term gain drops to $7,000. Federal tax falls to about $2,240. You also still own seven-tenths of the loser.
  • Harvest the full $10,000 loss. Net short-term gain is zero. Federal tax on that bucket is $0, and the loss has done its job.
Worked example: a $10,000 short-term loss harvested against a $10,000 short-term gain A bar chart comparing federal tax owed in three scenarios for an investor with $10,000 in short-term gains: do nothing, harvest a $3,000 loss, and harvest a $10,000 loss. The scenarios assume a 32 percent marginal federal rate. $0 $1,000 $2,000 $3,000 $4,000 $3,200 Do nothing $10k ST gain only $2,240 Harvest $3,000 loss net ST gain = $7,000 $0 Harvest $10,000 loss net ST gain = $0 Federal tax on $10,000 in short-term gains, by harvesting choice Investor with 32% marginal federal rate. State tax and the wash sale rule ignored for illustration. Federal tax owed
Worked example. Short-term gains are taxed at ordinary rates; see IRS Topic 409: Capital Gains and Losses.

Two nuances make the example slightly tidier than reality. First, harvesting a loss does not make the money disappear from your portfolio — you typically rotate the proceeds into a different but similar holding so you stay invested. Second, the loss reduces your cost basis in the replacement only if the wash sale rule applies; otherwise the replacement starts fresh. That second point is where investors get tripped up.

The wash sale rule, in plain English

Section 1091 of the Internal Revenue Code and IRS Publication 550 define a wash sale this way: you sell a security at a loss, and within 30 days before or after the sale you buy — or enter into a contract or option to buy — a substantially identical security. The loss is disallowed for the current tax year.

That window is 61 calendar days wide: 30 days before the loss sale, the sale day itself, and 30 days after.

The 61-day wash sale window A timeline showing the 30 calendar days before the sale, the sale day, and the 30 calendar days after the sale, totaling 61 days where buying a substantially identical security disallows the loss. 30 days BEFORE sale replacement purchases here trigger wash sale SALE at a loss day 0 30 days AFTER sale replacement purchases here trigger wash sale safe safe The wash sale "window" is 61 calendar days, not 30 30 days before the loss sale + the sale day + 30 days after = 61 days If you (or your spouse, or your IRA) buy a substantially identical security inside the orange band, the loss is disallowed.
Source: IRS Publication 550, "Investment Income and Expenses," Wash Sales section.

When a wash sale is triggered, two things happen, both per Pub. 550:

  • The disallowed loss is added to the cost basis of the replacement security. You eventually get the deduction when you sell the replacement — just not this year.
  • The holding period of the security you sold tacks onto the replacement. That prevents investors from converting a long-term loss into a more valuable short-term loss by churning the position.

The SEC’s investor education site frames it the same way and points readers back to Pub. 550 for the mechanics (SEC investor.gov: Wash Sales).

What counts as “substantially identical”?

This is the fuzziest part of the rule. The IRS has never published a bright-line test for ETFs, and most of the case law dates from the 1930s. A few things are clear:

You sell … You buy … Treated as “substantially identical”?
AAPL common stock AAPL common stock Yes — same security.
AAPL common stock AAPL call option Yes — an option to acquire the same stock counts.
SPY (S&P 500 ETF) IVV (different S&P 500 ETF) Likely yes — both track the same index; the IRS has not drawn a bright line, but most tax practitioners treat near-identical index trackers as substantially identical.
SPY (S&P 500 ETF) VTI (total US market ETF) Generally no — different index, different holdings.
AAPL common stock MSFT common stock No — different issuer.
AAPL in taxable account AAPL in your IRA Yes — loss permanently disallowed. The IRS ruled in 2008 that the disallowed loss cannot be added to IRA basis.
General guidance. The IRS has not defined “substantially identical” for ETFs. See IRS Pub. 550 and Rev. Rul. 2008-5 on IRA wash sales.

One trap deserves its own paragraph. In Revenue Ruling 2008-5, the IRS held that when you sell a stock at a loss in a taxable account and then buy the same stock inside your IRA within 30 days, the loss is disallowed and the basis adjustment does not apply — because IRA basis isn’t tracked the same way. The loss is permanently lost. Same principle applies to a spouse’s account: the IRS treats spouses as one taxpayer for wash sale purposes.

Common mistakes investors make

  • Forgetting reinvested dividends. If a mutual fund or ETF you also hold reinvests a dividend inside the 61-day window, that reinvestment is a purchase. It can trigger a partial wash sale on a loss you took elsewhere in the same fund.
  • Buying back too soon in a different account. The rule looks at you, not the account. Selling in a brokerage account and buying in a 401(k) or Roth IRA still triggers it.
  • Mistaking “tax loss” for “permanent loss.” A disallowed loss isn’t gone — the basis adjustment usually preserves it for later, with the major exception of the IRA case above.
  • Harvesting losses you can’t use this year. If you already have no gains and no ordinary income to offset, more than $3,000 of harvested losses just carries forward. That is fine, but the tax benefit is deferred.
  • Ignoring transaction costs and bid-ask spreads. For thinly traded names, the round-trip cost of harvesting can eat the tax savings.
  • Harvesting at year-end without watching the settlement date. For tax purposes, the trade date is what matters for stocks, but the wash-sale window is calendar days and crosses the year-end boundary. A January 5 buy can disallow a December 15 loss.

When investors typically do this

Harvesting is most valuable when you have realized gains you can offset, when you are in a high marginal bracket, or when you can carry a loss forward into a year you expect to have larger gains (think: a planned business sale or an options expiration). It is least valuable when your taxable account is mostly long-term gains taxed at 0%, because the marginal benefit of a harvested loss is also near zero.

Some investors also use a related strategy called tax-gain harvesting: in a year their income falls into the 0% long-term capital gains bracket, they sell winners to reset cost basis upward, then buy back immediately. The wash sale rule does not apply to gains — only losses — so this maneuver is legal and powerful for households with variable income.

What to learn next

Sources

Disclosure: This article was produced with AI assistance and reviewed before publication. It is for informational purposes only and is not investment advice.

Leave a Comment