FBFinbrief

Save tax

Tax-loss harvesting: How it works and how to do it right

Turn a losing investment into a tax deduction — without leaving the market or running afoul of the wash-sale rule.

By Finbrief Editorial Team· Reviewed by a Certified Financial Planner (CFP®)· Updated May 20, 2026· 12 min read

Tax-loss harvestingmeans selling an investment that's down to lock in a loss you can use to cut your tax bill — then reinvesting so you stay in the market.

Here's the core idea. When you sell an investment for less than you paid, you realize a capital loss. The IRS lets you use that loss to offset capital gains dollar-for-dollar, and to offset up to $3,000 of ordinary income per year on top of that. Any leftover loss carries forward to future years indefinitely.

Done well, it's one of the few ways to turn a market dip into a concrete tax benefit. Done carelessly, you trip the wash-sale rule and the deduction disappears. This guide covers exactly how it works, the rules that matter, and how to do it step by step. None of this is tax advice for your specific situation — confirm with a CPA or the IRS.


A simple example

Numbers make this concrete. Suppose you have two events in a taxable account this year:

EventWithout harvestingWith harvesting
Realized capital gain$5,000 (taxed)$5,000
Harvested loss$0$8,000
Net taxable gain$5,000$0
Offsets ordinary income$0$3,000
Loss carried to next year$0$0

Illustrative figures, not tax advice. The $8,000 loss wipes out the $5,000 gain and offsets the maximum $3,000 of ordinary income.

The result: instead of paying tax on a $5,000 gain, you owe nothing on it and shelter $3,000 of regular income. At a 24% marginal rate, that $3,000 offset alone is worth about $720— and you're still invested through a replacement fund.


The wash-sale rule — the one thing that trips people up

The biggest mistake is buying back the same investment too quickly. This is where the wash-sale rule applies.

What is the wash-sale rule?The IRS disallows your loss if you buy the same or a "substantially identical" security within 30 days before or afterthe sale — a 61-day window total. The loss isn't destroyed; it's added to the cost basis of the replacement shares and deferred until you sell those.

How do you avoid it? Reinvest in something similar but not identical. The standard move is to swap one index fund for another that tracks a different index but gives you nearly the same market exposure.

  • Allowed: Sell an S&P 500 fund, buy a total U.S. stock market fund. Similar exposure, different index — not substantially identical.
  • Risky: Sell one S&P 500 fund and buy another fund tracking the same S&P 500 index. The IRS hasn't fully defined "substantially identical" for index funds, so most advisors avoid this.
  • Not allowed: Sell a stock, then rebuy the identical stock within 30 days. Classic wash sale.
  • Watch your IRA: A purchase of the identical security in your IRA can also trigger the rule. The window spans all your accounts, including a spouse's.

The rules that govern the benefit

A few IRS mechanics determine how much a harvested loss is actually worth:

  • Losses offset gains first. Short-term losses offset short-term gains (taxed at higher ordinary rates), and long-term losses offset long-term gains, before crossing over.
  • $3,000 income offset. After wiping out gains, up to $3,000 of remaining loss offsets ordinary income each year ($1,500 if married filing separately).
  • Unlimited carryforward. Any loss beyond that carries forward to future tax years with no expiration, ready to offset future gains or income.
  • Taxable accounts only. Harvesting does nothing in an IRA, Roth IRA, or 401(k) — those accounts aren't taxed year to year.

How to harvest a loss, step by step

The actual process takes a few minutes per position once you know the sequence.

  1. Review your taxable account for losers. Look only at your taxable brokerage account. Find positions trading below your cost basis.
  2. Confirm it's worth it. Make sure the tax benefit outweighs trading friction. Prioritize short-term losses, which offset the highest-taxed gains first.
  3. Sell the position. Realize the loss and note the date — the 61-day wash-sale window centers on it.
  4. Reinvest in a similar, non-identical asset. Keep your target allocation while sidestepping the wash-sale rule.
  5. Document it. Keep trade confirmations; the loss flows onto Schedule D and Form 8949 at tax time.

Should you automate it?

Harvesting by hand once a year is fine, but it misses dips that recover before December. Robo-advisors automate the process, scanning daily and executing wash-sale-safe swaps for you — useful if you have a large taxable balance and don't want to monitor it.

ApproachBest forTrade-off
Do it yourselfSimple portfolios, low costMisses intra-year dips; manual effort
Robo-advisor (automated)Large taxable balances, hands-offAdvisory fee (~0.25%/year)

Betterment and Wealthfront both build automated daily tax-loss harvesting into their taxable accounts:

Prefer to keep it manual and free? A brokerage like Fidelity lets you harvest yourself with no advisory fee:

Open a Fidelity brokerage account


When tax-loss harvesting is NOT worth it

  • You're in the 0% capital gains bracket. If your income is low enough that long-term gains are taxed at 0%, harvesting offers little benefit.
  • The position is in a retirement account. Nothing to harvest — gains and losses aren't taxed year to year.
  • You'd violate your allocation. Never let the tax tail wag the investment dog. Don't sell into a worse portfolio just to book a loss.
  • The loss is tiny. Below a few hundred dollars, the effort and bid-ask friction may outweigh the benefit.

The bottom line

Tax-loss harvesting lets you convert a paper loss into a real tax benefit: it offsets capital gains dollar-for-dollar, shelters up to $3,000 of ordinary income a year, and carries the rest forward indefinitely.

The two rules to remember: it only works in a taxable account, and you must avoid buying a substantially identical security within the 61-day wash-sale window. Stay invested through a similar replacement fund, document the trades, and confirm the specifics with a CPA or the IRS for your situation.

Related reading

Frequently asked questions

What is tax-loss harvesting in simple terms?
It's selling an investment that has dropped in value to lock in a capital loss, then using that loss to offset capital gains and up to $3,000 of ordinary income on your tax return. You typically reinvest the proceeds in a similar (but not 'substantially identical') asset so you stay invested while banking the tax benefit.
What is the wash-sale rule?
The IRS wash-sale rule disallows a loss if you buy the same or a 'substantially identical' security within 30 days before or after the sale — a 61-day window total. If you trip it, the loss is deferred, not lost, by adding it to the cost basis of the replacement shares. Avoid it by buying a similar-but-different fund.
How much can tax-loss harvesting save me?
It depends on your gains and tax rate. Harvested losses first offset capital gains dollar-for-dollar; any excess offsets up to $3,000 of ordinary income per year, with the rest carried forward indefinitely. At a 24% marginal rate, offsetting $3,000 of income saves about $720 in a year — plus whatever you save on offset gains.
Can I tax-loss harvest in my IRA or 401(k)?
No. Tax-loss harvesting only works in a taxable brokerage account. Gains and losses inside IRAs, Roth IRAs, and 401(k)s aren't taxed year to year, so there's nothing to harvest. Selling a loser inside a retirement account gives you no deductible loss.
Does tax-loss harvesting eliminate taxes or just delay them?
Mostly it defers them. Selling at a loss and buying a replacement lowers your cost basis, so you may owe more when you eventually sell the replacement. The benefit comes from deferring tax (your money compounds longer), offsetting income taxed at higher ordinary rates, and the step-up in basis at death, which can erase the deferred gain entirely.
When is the best time to harvest losses?
Many investors do a year-end review in November or December, but losses can be harvested any time markets dip. The trades must settle by December 31 to count for that tax year. Automated robo-advisors check for harvesting opportunities daily, which captures more transient dips than an annual sweep.
Do I have to reinvest the proceeds?
No, but most people do — the goal is to stay invested while capturing the loss. The key is to buy something similar enough to keep your target allocation but different enough to avoid the wash-sale rule, such as swapping one total-market index fund for another tracking a different index.