Skip to content
The Evergreen Edit
Save app to home screen
Private Wealth

Tax-Loss Harvesting Explained: Turning Investment Losses Into Tax Savings

Selling investments at a loss can offset gains and lower your tax bill. Here's how tax-loss harvesting works and the wash-sale rule.

By Kiara Miller, Founder & Editor

Published · Last reviewed: · 7 min read

An investor in an elegant private study reviewing a portfolio with red and green chart lines on a laptop alongside a wealth advisor, deciding which holdings to sell

Market drops are never fun, but they can create a real tax-planning opportunity in a regular brokerage account. That’s the idea behind tax-loss harvesting: you lock in a loss on paper, use it to shrink your tax bill, and stay invested. Used carefully, it can leave you with more money after taxes. Used carelessly, it can trip the wash-sale rule and cost you the deduction.

What is tax-loss harvesting?

Tax-loss harvesting is selling an investment in a taxable account for less than you paid so the capital loss can offset capital gains. Extra losses can reduce other income by up to $3,000 a year, and any remainder carries forward. You can reinvest in something similar, but not substantially identical, within the wash-sale window.

It only works in taxable accounts. Gains and losses inside IRAs and 401(k)s don’t appear on your tax return, so there’s nothing to harvest there.

How the math works

When an investment is worth less than you paid, you have an unrealized loss. Selling it turns that into a realized capital loss. Losses are first netted against gains of the same type, short-term against short-term and long-term against long-term, and any excess then offsets the other type. Offsetting short-term gains is especially valuable because they’re taxed at ordinary income rates.

If losses exceed gains, the IRS lets you deduct the lesser of $3,000 or your net loss against other income, or $1,500 if you’re married filing separately. Anything beyond that carries forward to future years.

A worked example

Take a hypothetical single investor in the 24% federal bracket who pays 15% on long-term gains. She sold one fund this year for a $12,000 long-term gain. Her tax on that gain would be $1,800.

She also holds another fund showing an $18,000 long-term loss. If she sells it:

  1. $12,000 of the loss wipes out the gain, saving $1,800.
  2. $3,000 of the remaining $6,000 offsets wages, saving about $720 at 24%.
  3. The last $3,000 carries forward to next year.

That’s about $2,520 in federal tax saved this year, plus a $3,000 carryforward. For higher earners the numbers grow. Long-term gains can face 20%, plus the 3.8% net investment income tax when modified adjusted gross income tops $200,000 for single filers or $250,000 for joint filers, so each $10,000 of gains offset could save as much as $2,380.

When harvesting doesn’t help

For 2026, the 0% long-term rate applies up to $49,450 of taxable income for single filers and $98,900 for joint filers, and the 15% rate runs to $545,500 and $613,700. If your gains are taxed at 0%, using a loss against them saves nothing, though the $3,000 offset against other income can still help. Our guide to capital gains taxes covers how these rates work.

The wash-sale rule

This is the rule to respect. Under federal tax law, no loss is allowed if you acquire substantially identical stock or securities within a period running from 30 days before the sale to 30 days after it. Regulations call this the 61-day period. Buying through a contract or option counts too.

Here’s how it plays out. You buy 100 shares at $50 and sell at $40, a $1,000 loss. Twenty days later you buy 100 shares back at $42. The loss is disallowed, but it isn’t gone: it’s added to your new basis, so your basis becomes $52 a share rather than $42. Your holding period carries over as well. You’ve deferred the loss rather than used it.

Buying back in an IRA is worse. The IRS ruled in Rev. Rul. 2008-5 that when you sell at a loss and buy the same stock in an IRA or Roth IRA within the window, the loss is disallowed and your IRA basis doesn’t increase. In that case the tax benefit is simply lost.

IRS guidance also treats purchases by your spouse or a corporation you control as triggering a wash sale, and automatic dividend reinvestment is a purchase like any other. If a fund pays and reinvests a dividend within the window, those shares can create a partial wash sale.

Staying invested

Selling doesn’t mean leaving the market. Many investors buy a similar but not substantially identical holding, such as a fund tracking a different index, or a sector fund after selling a single stock. After 31 days they can switch back if they prefer.

The law doesn’t spell out precisely what “substantially identical” means for funds. Selling one S&P 500 fund and buying another S&P 500 fund from a different company is the gray area many investors avoid. Choosing a fund with a different index is the more cautious approach. Staying invested matters because markets can rebound quickly, and sitting in cash for a month can cost more than the tax break.

The catch: deferral, not elimination

Harvesting usually lowers your cost basis. Say a $50,000 position falls to $40,000, you sell, and you buy a similar fund for $40,000. If that fund later reaches $60,000, your taxable gain is $20,000 rather than the $10,000 you’d have had without harvesting. You saved tax now and owe more later.

That can still be a good trade. Money you don’t pay in tax today can stay invested, and you may be in a lower bracket when you sell. Assets held until death generally receive a basis equal to fair market value at that date, and donating appreciated shares to charity can avoid the gain as well. Our guide to donor-advised funds explains that option.

When to harvest

Opportunities tend to appear during market drops or when a single holding falls, so it makes sense to review periodically rather than only in December. Losses must be realized by December 31 to count for that tax year. Watch out for year-end distributions from mutual funds too, since buying back into a fund just before a payout can leave you with a taxable distribution.

A pre-sale checklist

  1. Confirm the holding is in a taxable account.
  2. Add up realized gains so far this year, and note which are short-term.
  3. Check the purchase dates of every lot, and sell the highest-cost lots if your broker allows it.
  4. Look back 30 days for purchases, including reinvested dividends, in all household accounts.
  5. Turn off reinvestment and pause automatic contributions to the same fund.
  6. Pick a replacement that isn’t substantially identical.
  7. Mark the date 31 days out before buying the original back.

Report sales on Form 8949 and Schedule D, and keep your own record of disallowed losses and carryforwards. If you hold the same fund at several brokers, none of them sees the whole picture, so tracking is your job.

Mistakes to avoid

  • Letting the tax tail wag the dog. Don’t sell a holding you’d otherwise want to change just for a modest tax saving, or abandon your asset allocation.
  • Forgetting other accounts. A purchase in your IRA, or a reinvested dividend in a second brokerage account, can undo the harvest.
  • Harvesting small losses. Trading costs, spreads and your time can outweigh a very small deduction.
  • Harvesting in a 0% year. If your gains are taxed at 0%, you may be better off realizing gains rather than losses.
  • Losing the paper trail. Keep records of your sale dates, cost basis and carryforwards so they’re ready at tax time, and carry unused losses onto next year’s return.

Automated harvesting and direct indexing

Some robo-advisers and wealth managers harvest losses automatically and avoid wash sales inside the accounts they manage, though they may not see your other accounts. Direct indexing, which means owning an index’s individual stocks rather than a fund, can offer more chances to harvest. Compare any extra fees with the realistic tax savings, particularly if you’re in a lower bracket.

For a wider look at how this fits with other moves, see our guide to net investment income tax. A tax professional can help you track basis and carryforwards, especially across multiple accounts.

Frequently asked questions

How much in capital losses can I deduct each year?

Losses first offset capital gains without a dollar cap. Beyond that, you can deduct up to $3,000 of net capital losses against other income, or $1,500 if married filing separately, and carry the rest forward.

Can I buy the same stock back after a loss sale?

Yes, but wait until 31 days after the sale, and make sure you didn’t buy in the 30 days before it. Otherwise the wash-sale rule disallows the loss for now.

Does tax-loss harvesting work in a Roth IRA or 401(k)?

No. Gains and losses inside tax-advantaged accounts don’t affect your annual tax return, so it only applies to taxable brokerage accounts.

Is tax-loss harvesting worth it in a low tax bracket?

Often less so. If your long-term gains already qualify for the 0% rate, the main benefit is the offset against ordinary income, and the lower basis could mean more tax later.

Content on The Evergreen Edit is for educational and informational purposes only and is not individualized financial, investment, tax or legal advice. Learn more.

Compound growth estimate

Estimated total

$17,175

Your contributions

$13,000

This is an estimate, not a prediction. Monthly compounding; taxes, fees and inflation are excluded.

This article is for educational purposes only and isn't personalized financial, tax or legal advice. Consider talking with a qualified professional about your situation.

Kiara Miller

Kiara Miller — Founder & Editor

Kiara Miller is the founder and editor of The Evergreen Edit. He has been doing independent finance research for two decades, is a tax preparer, and reviews every article before it's published.

More about Kiara →

Get smarter about your money.

Join readers who get money stories on their chosen topics, daily or as new articles post.

Which topics do you want in your inbox? Pick up to 3
Email frequency

We'll use your answers to send articles you care about and to plan new content. We never sell your info. Privacy Policy

An affluent couple meeting their tax advisor at a mahogany desk, reviewing investment statements and a calculator
Private Wealth

The Net Investment Income Tax Explained

High earners may owe an extra 3.8% tax on investment income. Here's who owes it, how to calculate it and legal ways to reduce it.

Kiara Miller7 min read

Recommended reading