Portfolio Lab

Tax-loss harvesting: turning investment losses into tax savings

In depth10 min read · updated 12 November 2026 · 10 sources

Tax-loss harvesting means selling an investment that trades below what you paid for it, booking the loss for your tax return and staying invested with a similar replacement. The loss offsets capital gains and up to $3,000 of ordinary income a year, and whatever is left carries forward. This article shows how the netting works in 2026, why the saving is partly a deferral, how the wash sale rule gets in the way and what research says the strategy is worth.

What tax-loss harvesting is

In a taxable brokerage account, a capital loss only counts once you sell. A falling position therefore holds an option: you can realize the loss now, use it to cut this year's tax, and put the money straight back into the market. The portfolio looks almost the same afterwards, but your tax return does not. Inside a traditional IRA, a Roth IRA or a 401(k) there is nothing to harvest, because gains and losses there have no tax effect.

The loss is the sale price minus the cost basis of the shares you sell. If you bought the same fund at different times, each purchase is a separate lot, and choosing the lot with the highest basis (specific identification) produces the largest loss. A lot held for one year or less gives a short-term loss, a lot held longer a long-term loss (IRS Topic 409 2026).

sale price minus cost basis of the lots sold
15% or 20% against long-term gains, your ordinary rate against short-term gains and up to $3,000 of other income

How harvested losses are used

Losses are netted in a fixed order on Schedule D. Short-term losses first offset short-term gains and long-term losses offset long-term gains; then the two results are combined. If a net loss remains, you can deduct up to $3,000 of it from other income ($1,500 if married filing separately), and the rest carries forward to later years without expiring (IRS, Schedule D instructions 2025). A carryover keeps its character, so a short-term loss carried into next year still offsets short-term gains first (IRS Topic 409 2026).

That order decides what a harvested loss is worth. Offsetting a short-term gain or ordinary income saves tax at your full bracket rate of up to 37%. Offsetting a long-term gain saves 15% or 20%, and nothing at all if the gain would have fallen into the 0% range anyway. Harvested losses also reduce net investment income, so they can lower the 3.8% NIIT for high earners (IRS Topic 559 2026).

The catch: a lower basis means more tax later

Harvesting does not make the loss disappear from your portfolio. The replacement shares are bought at today's lower price, so their cost basis is lower, and a later sale shows a larger gain. In the plain case the tax you save now comes back later. The strategy still pays for three reasons: the money saved can stay invested for years, the later tax may be charged at a lower rate, and in some cases it is never charged at all.

Harvesting a $3,000 loss: tax saved now and extra tax later

Single filer in the 24% bracket. The $3,000 deduction saves $720 now; the replacement shares carry $3,000 more gain. Ignores the investment return on the money saved.

In the example, deducting $3,000 against wages saves $720 at 24%. If the replacement is sold later as a long-term gain at 15%, the extra tax is $450, so $270 is a permanent gain on top of the deferral. If the shares are sold in a low-income year in the 0% range, donated to charity or inherited with a stepped-up basis (26 U.S.C. § 1014 1954), the extra tax never arrives. The reverse also happens: a loss that only offsets long-term gains taxed at 15% today, followed by a later sale at 20% plus NIIT, is a bad trade apart from the deferral.

Staying invested without a wash sale

A loss does not count if you buy substantially identical stock or securities within 30 days before or after the sale, acquire them in a fully taxable trade, enter into a contract or option to buy them, or buy them for your IRA or Roth IRA (IRS, Schedule D instructions 2025). The window covers 61 days in total, and it is set by section 1091 of the Internal Revenue Code (26 U.S.C. § 1091 1954). Purchases by your spouse count too (IRS Publication 550 2025).

In a regular account the disallowed loss is not gone: it is added to the cost basis of the new shares, and the holding period carries over. A repurchase in an IRA is the exception, because the basis adjustment does not apply there and the loss is lost for good (IRS, Schedule D instructions 2025). Reinvested dividends and automatic monthly purchases are the usual way investors trigger a wash sale by accident.

  • Switch to a similar fund: sell an S&P 500 fund and buy a total market or large-cap fund that tracks a different index; the exposure stays close, but the securities differ.
  • Wait 31 days: buy the same fund back after the window closes and accept a month out of the market.
  • Double up first: buy the same amount of the fund, wait 31 days, then sell the original lot with specific identification; this needs extra cash for a month.

Switching between two funds that track the same index from different providers is the gray zone. The law gives no bright line for when two funds are substantially identical, and a careful investor avoids pairs that hold the same securities in the same weights.

What research says it is worth

Constantinides (1983) showed that, when only realized gains are taxed, the optimal policy is to realize losses as soon as they occur and to postpone gains. Later studies put numbers on the idea. Berkin and Ye (2003) simulated portfolios over long horizons and found that regular contributions, volatile holdings and low market returns create more harvesting opportunities, while withdrawals reduce them. Chaudhuri et al. (2020) tested the strategy on the 500 largest US stocks over almost a century and found a positive annual benefit before costs, which shrinks but remains when the wash sale rule is applied.

Two patterns stand out across these studies. First, the benefit is largest in the early years of a position, because over time the portfolio's basis drifts down and fewer lots fall below their cost. Second, holding many individual stocks harvests more than holding one broad fund, because single stocks scatter more widely and some fall even when the index rises. That is the logic behind direct indexing. Both effects are about opportunity, not certainty: the value depends on your tax rates today and later, and on what eventually happens to the replacement shares.

Harvesting gains in the 0% bracket

The mirror image works for investors with low taxable income. Long-term gains are taxed at 0% as long as taxable income including the gains stays at or below $49,450 for single filers and $98,900 for married couples filing jointly in 2026 (Rev. Proc. 2025-32 2025). Selling appreciated shares up to that limit and buying them back immediately raises the cost basis at no federal cost. The wash sale rule only applies to losses, so the repurchase can happen the same day.

When harvesting does not help

  • Your rate is low now and high later: a loss that offsets 0% gains is wasted, and the lower basis may be taxed at 15% or more later.
  • The trade costs more than it saves: spreads, commissions and a replacement fund with higher fees eat small losses quickly.
  • The replacement drifts: a different index can perform differently from the fund you sold, and that tracking risk is real money.
  • Your state does not play along: Pennsylvania and New Jersey, for example, do not let a net loss carry forward or offset wages, so the state saving is smaller than the federal one.
  • You need the account to stay simple: harvesting creates many lots and Form 8949 lines, and wash sales across several accounts are your job to track, not the broker's.

Common mistakes

  • Buying back inside the window: in the same account, in an IRA or through dividend reinvestment.
  • Selling the wrong lot: first in, first out may sell an old lot with a gain instead of the new lot with the loss.
  • Harvesting for the deduction alone: $3,000 a year against wages is useful, but large harvested losses are worth most when gains are coming.
  • Forgetting the carryover: losses that were not used must be entered again on next year's return.
  • Waiting for December: declines happen at any time of year, and the best opportunities are often gone by year end.

This article explains general federal rules as of 2026 and is not tax advice. State rules differ; check current IRS guidance or ask a tax professional before acting.

Frequently asked questions

How much can I save with tax-loss harvesting?

It depends on what the loss offsets. Against short-term gains or up to $3,000 of ordinary income, each dollar of loss saves your full bracket rate, up to 37%. Against long-term gains it saves 15% or 20%. Part of the saving is a deferral, because the replacement shares have a lower cost basis.

Is tax-loss harvesting worth it?

It is most useful if you have realized gains or a high bracket now, invest new money regularly, hold volatile positions, or expect to keep the replacement shares until death or donate them. It is worth little if your gains would be taxed at 0% anyway or if trading costs and tracking risk are large.

How long do I have to wait to buy back the same investment?

More than 30 days after the sale. A purchase within 30 days before or after a loss sale, including in an IRA or by your spouse, makes it a wash sale and disallows the loss for now.

Can I harvest losses in my IRA or 401(k)?

No. Gains and losses inside tax-advantaged accounts have no tax effect. Buying the same security in your IRA within 30 days of a loss sale in a taxable account even makes the loss permanently nondeductible.

What happens to losses I cannot use this year?

After offsetting all capital gains and $3,000 of other income, the rest carries forward to later years without a time limit and keeps its short-term or long-term character.

What is tax-gain harvesting?

The opposite move: realizing long-term gains while they fall into the 0% bracket and buying the shares back at once. It raises your cost basis without federal tax and is allowed immediately, because the wash sale rule applies only to losses.

Literature

  1. Berkin, Andrew L.; Ye, Jia (2003): Tax Management, Loss Harvesting, and HIFO Accounting. Financial Analysts Journal 59 (4), pp. 91–102. doi:10.2469/faj.v59.n4.2548
  2. Chaudhuri, Shomesh E.; Burnham, Terence C.; Lo, Andrew W. (2020): An Empirical Evaluation of Tax-Loss-Harvesting Alpha. Financial Analysts Journal 76 (3), pp. 99–108. doi:10.1080/0015198X.2020.1760064
  3. Constantinides, George M. (1983): Capital Market Equilibrium with Personal Tax. Econometrica 51 (3). doi:10.2307/1912150
  4. Internal Revenue Service (2025): Instructions for Schedule D (Form 1040) (2025), Capital Gains and Losses. Internal Revenue Service; accessed November 10, 2026. Source
  5. Internal Revenue Service (2025): Revenue Procedure 2025-32: inflation-adjusted items for 2026. Internal Revenue Bulletin 2025-45; accessed November 2, 2026. Source
  6. Internal Revenue Service (2025): Publication 550 (2025), Investment Income and Expenses. Internal Revenue Service; accessed November 2, 2026. Source
  7. Internal Revenue Service (2026): Topic no. 409, Capital gains and losses. Internal Revenue Service, last reviewed September 24, 2026; accessed November 2, 2026. Source
  8. Internal Revenue Service (2026): Topic no. 559, Net investment income tax. Internal Revenue Service, last reviewed September 24, 2026; accessed November 2, 2026. Source
  9. United States Congress (1954): United States Code, Title 26 (Internal Revenue Code), § 1014 Basis of property acquired from a decedent. Legal Information Institute, Cornell Law School; accessed October 26, 2026. Source
  10. United States Congress (1954): United States Code, Title 26 (Internal Revenue Code), § 1091 Loss from wash sales of stock or securities. Legal Information Institute, Cornell Law School. Source

Full bibliography

This article explains a method; it is not investment or tax advice. Worked examples are simplified and rounded. All terms in the glossary.