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:
- Short-term losses first offset short-term gains (taxed at your ordinary income rate, which can be as high as 37%).
- Long-term losses first offset long-term gains (taxed at 0%, 15%, or 20% depending on income — see table below).
- If one bucket has leftover losses, they cross over to offset gains in the other bucket.
- 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 |
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.
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.
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. |
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
- EPS and diluted EPS — how the earnings number you see in headlines is built.
- Stock buybacks and taxes — including the 1% excise tax companies face.
- CAPE ratio — why valuation matters more for long-horizon investors than market timers.
Sources
- IRS Publication 550: Investment Income and Expenses (Wash Sales section)
- IRS Topic No. 409: Capital Gains and Losses
- IRS Rev. Proc. 2025-32 — 2026 inflation adjustments (long-term capital gains thresholds)
- IRS Revenue Ruling 2008-5 — wash sale loss disallowed when replacement bought in IRA
- SEC investor.gov — Wash Sales glossary entry
Disclosure: This article was produced with AI assistance and reviewed before publication. It is for informational purposes only and is not investment advice.