Tax-loss harvesting (TLH) is the practice of selling investments at a loss specifically to offset gains elsewhere, generating tax savings without changing your overall investment exposure. Done correctly, it can save thousands of dollars a year in a taxable brokerage account, with the benefit compounding over decades.

But done wrong, and the wash-sale rule catches everyone the first time, it can result in disallowed losses, basis errors, and tax-prep headaches.

How tax-loss harvesting works

The basic mechanics:

  1. Sell a security at a loss.
  2. The loss offsets capital gains first (short-term losses against short-term gains, long-term against long-term, then cross-class).
  3. Excess losses (up to $3,000/year) offset ordinary income.
  4. Anything beyond $3,000 carries forward indefinitely to future tax years.

Example: in 2026 you have $10,000 of realized capital gains from selling NVDA, and $5,000 of unrealized loss on TSLA. If you harvest the TSLA loss:

  • TSLA loss ($5K) offsets $5K of NVDA gain → only $5K is taxable.
  • Tax saved: $5,000 × 23.8% (LTCG + NIIT for high earners) = $1,190

Repeat across your portfolio annually, and the tax savings compound. A taxable brokerage with disciplined annual TLH and proper rebalancing typically generates 0.5-1.0% of additional return per year, after-tax.

The wash-sale rule (the trap)

The IRS won’t let you sell a stock at a loss and immediately buy it back to “lock in” the loss. The rule: if you (or your spouse, or your IRA) buy a “substantially identical” security within 30 days before OR after the loss sale, the loss is disallowed and added to the basis of the new purchase.

What counts as substantially identical:

  • Same stock (selling AAPL and buying AAPL back), clearly disallowed.
  • Same ETF/mutual fund (selling VOO and buying VOO back), clearly disallowed.
  • Different ETFs tracking the same index, gray area. SPY → VOO (both track S&P 500) the IRS has not formally ruled, but most tax advisors treat this as a wash sale.
  • Different index ETFs in different sectors, clearly OK (selling VOO and buying VEA total international).
  • Stocks of different but similar companies, generally OK (selling Coca-Cola and buying Pepsi).

The safest path: buy a fund tracking a different (but correlated) index for 30+ days, then either swap back or stay put. Common pairs:

SoldBought (safe replacement)
VOO (S&P 500)IVV (S&P 500), risky, also S&P 500. Better: VTI (total market)
VTI (Total US Market)ITOT or SCHB (different sponsors, total US market)
VEA (Developed International)IXUS or VXUS
BND (Total US Bond)AGG or IUSB

After 31 days, you can swap back if desired, your loss remains harvested.

What does NOT count as a wash sale

  • Selling stocks for a gain, wash-sale rule only applies to losses.
  • Selling and buying via completely different account types (e.g., taxable brokerage to a 401(k), though this is questionable and rarely worth it).
  • A purchase before the harvested-loss sale that’s separated by more than 30 days.

The 30-day window, both directions

Easy to miss: the wash-sale rule looks 30 days BEFORE and 30 days AFTER the loss sale. So if you bought TSLA two weeks ago and now sell it at a loss, the recent purchase wash-sales your earlier loss attempt.

For active investors: harvest losses BEFORE rebalancing into similar securities, not after.

How to set up TLH correctly

Step 1: Identify lots to harvest

Use your broker’s specific-identification feature. Sort positions by unrealized loss and identify lots with significant losses. Don’t harvest tiny losses ($50-$200), the cost of tracking exceeds the savings.

Step 2: Decide on the replacement

Pick a “TLH partner”, a different fund tracking a similar (but legally distinct) index. Stay in this partner for 31+ days.

Step 3: Execute the swap

Sell the loss position. Immediately buy the partner with the proceeds. Maintain market exposure throughout.

Step 4: Track the basis

Your broker should automatically show the realized loss on your year-end 1099-B. If you’ve held the partner for 31+ days, you can swap back to your original position with no wash-sale issue.

Step 5: Report on Form 8949 + Schedule D

The realized loss flows through to your tax return. Use the IRS-provided Form 8949 + Schedule D.

The $3,000 annual cap on offsetting ordinary income

If you have no capital gains and harvest $20,000 of losses:

  • $20,000 offsets $20,000 of capital gains → save nothing.
  • BUT $3,000 of the loss offsets ordinary income.
  • Remaining $17,000 carries forward indefinitely.

At a 32% marginal bracket, $3,000 of ordinary-income offset = $960 tax savings.

The $3,000 cap hasn’t been adjusted for inflation since 1978. Multiple bills propose increasing it; none have passed.

Pairing TLH with rebalancing

The best TLH timing is during your annual rebalancing in late November / early December. Reasons:

  • You’re already moving money around → TLH costs nothing extra in transaction effort.
  • Year-end timing locks in the loss for that tax year.
  • Markets often dip in November-December → more opportunities.

Set a calendar reminder for Nov 15. Look at your portfolio, identify loss positions, harvest, swap to TLH partner, document, repeat next year.

Common mistakes

Buying back within 30 days. The #1 wash-sale violation. Always wait 31 calendar days, OR buy a non-substantially-identical partner.

Selling in a Roth IRA at a loss for the deduction. Losses inside an IRA don’t transfer to your taxable return. Don’t try.

Selling part of a position from a different lot than the one with the loss. Use specific-identification (SpecID) cost basis at your broker. FIFO is the default and may sell wrong lots.

Treating cap gains losses as ordinary deductions. The $3,000 cap applies; excess carries forward as a CAPITAL loss (not as an ordinary loss).

Ignoring state taxes. Most states follow federal cap-gains treatment. CA does. NY does. WA’s new 7% LTCG tax also applies. Track state separately.

Forgetting to switch back. Some people TLH into a partner and forget to swap back to their preferred fund. After 31 days, you can swap back without wash-sale risk, and should if you have a preference.

When TLH doesn’t pay off

  • Tiny portfolios. $50K portfolio with $1,000 in unrealized losses isn’t worth the effort.
  • Tax-advantaged accounts only. TLH only works in taxable brokerage.
  • Low marginal bracket. Filers in the 10-12% bracket save very little per harvested dollar.
  • Highly tax-efficient ETFs already. TLH benefits diminish when your portfolio is already broad-index, low-turnover.

Worked example

High-income tech worker in California, 35% federal + 13.3% CA marginal.

End of 2026: $200,000 of harvested losses across the year (volatile market). Realized $40,000 of gains during the year.

  • $40K loss offsets $40K of gain → save $19,160 in tax (40K × 48.3% effective)
  • $3K of remaining loss offsets ordinary income → save $1,449
  • $157K of losses carry forward indefinitely

In a normal year (no big realized gains), TLH still produces $1,449 of ordinary-income offset. Compound 30 years at 7% real → ~$140K of wealth created from this one mechanic.

Run scenarios with our Tax-Loss Harvesting Calculator.

Other countries

TLH or equivalent capital-loss offset exists in most developed economies:

  • United Kingdom, capital losses offset future gains; £3,000 annual exempt amount; no carry-back.
  • Canada, allowable capital losses offset gains; superficial loss rule (30-day window on both sides) parallels US wash-sale.
  • Australia, losses offset gains; no annual ordinary-income offset cap.
  • India, STCG/LTCG losses set off similarly; LTCG losses only against LTCG.

Primary sources