What is tax-loss harvesting?

Selling investments at a loss on purpose sounds backwards, but it can lower your tax bill. Here is how the strategy works, what the rules actually say, and when it is not worth the trouble.

Selling an investment that lost money on purpose sounds like admitting defeat. It is actually one of the few genuinely useful tax strategies available to ordinary investors.

Short answer: tax-loss harvesting means selling investments that have dropped in value to realize the loss on paper, then using that loss to offset taxes you would otherwise owe on your gains. You sell the loser, buy something similar so you stay invested, and your tax bill goes down.

It will not make you rich. It will not fix a bad portfolio. But if you pay taxes on investment gains in a taxable account, it is worth understanding. Here is the whole thing, plainly.

What tax-loss harvesting actually does

When you sell an investment for more than you paid, the IRS taxes the profit as a capital gain. When you sell for less than you paid, you have a capital loss. The tax code lets you use those losses to cancel out your gains.

Harvesting means doing this deliberately. You look at your taxable brokerage account, find positions trading below what you paid, and sell them to capture the loss. You then use that loss to reduce the taxes on gains you have realized elsewhere, or even on some of your ordinary income.

One important limit: this only matters in taxable accounts. Losses inside a 401(k), IRA, or Roth IRA do nothing for you on your taxes, because those accounts are already tax-sheltered. Harvesting there is pointless.

The basic mechanics, with real numbers

Say you bought 200 shares of a fund at $100 each — $20,000 total. It now trades at $60. Your position is worth $12,000, and you are sitting on an $8,000 unrealized loss. Unrealized means it does not count for taxes yet. The IRS only cares when you sell.

Now suppose earlier this year you sold some stock for a $5,000 profit. That gain would normally be taxed. But if you sell your losing fund now, the $8,000 realized loss wipes out the $5,000 gain completely, and you have $3,000 of loss left over.

That leftover $3,000 is not wasted. The IRS lets you deduct up to $3,000 of net capital losses against your ordinary income each year — your salary, for example. ($1,500 if you are married filing separately.) So in this scenario, all $8,000 of your loss gets used: $5,000 against the gain, $3,000 against your wages. At a 24% tax bracket, that $3,000 deduction saves you $720 in taxes, and wiping out the $5,000 gain saves more on top of that.

The key detail most explanations skip: you do not have to spend the sale proceeds. You can immediately buy a similar (but not identical) investment and stay in the market. The loss is real for tax purposes even though your portfolio barely changed.

Short-term and long-term are different games

Capital gains and losses come in two flavors. Hold an asset for a year or less and any gain is short-term, taxed at your ordinary income rate — up to 37% at the federal level in 2026. Hold longer than a year and the gain is long-term, taxed at the gentler 0%, 15%, or 20% rates.

When you harvest, the IRS makes you net things in a specific order. Short-term losses first offset short-term gains. Long-term losses first offset long-term gains. Only after that does any leftover loss cross over to the other category. If a net loss remains after all offsetting, then up to $3,000 can go against ordinary income, and the rest carries forward.

This ordering matters because a dollar of loss is worth most when it offsets a short-term gain taxed at your highest rate. Harvesting a loss to erase a long-term gain taxed at 15% still saves money, just less per dollar. It is a detail worth knowing, but do not contort your whole portfolio around it.

Losses you cannot use yet carry forward forever

There is no limit to how much loss you can use against gains in a single year — the limit only applies to the slice deducted against ordinary income. If your harvested losses exceed your gains plus $3,000, the excess carries forward to future tax years. Indefinitely.

The carryforward keeps its character: a short-term loss carries over as a short-term loss, and it will offset short-term gains first in the year you use it. So a big loss harvested during a market crash can keep paying you back year after year, $3,000 at a time, until it runs out.

Go back to the earlier example but make the loss $15,000 instead of $8,000. It would wipe out the $5,000 gain, deduct $3,000 against your salary this year, and carry $7,000 into next year. That $7,000 then works against next year's gains first, and any remainder gets its own $3,000 slice against ordinary income.

The wash-sale rule is the one you must respect

The IRS saw the obvious trick coming: sell a loser, claim the loss, immediately buy it back. That is why the wash-sale rule exists. If you sell a security at a loss and buy a "substantially identical" security within 30 days before or after the sale — a 61-day window in total — your loss is disallowed for that year.

The disallowed loss is not gone. It gets added to the cost basis of the replacement shares, so you recover the benefit when you eventually sell those shares for real. It is a delay, not a fine — with one nasty exception, covered below.

"Substantially identical" has never been precisely defined by the IRS, which is part of the annoyance. The common practice: selling one S&P 500 ETF and buying a different provider's S&P 500 ETF is widely treated as fine, since they are legally different funds. But selling the same ETF and buying it back 10 days later is clearly a wash sale. When in doubt, wait 31 days before repurchasing the identical security.

Also note: as of 2026, the wash-sale rule generally does not apply to cryptocurrency, because crypto is treated as property rather than a security under current law. That could change — lawmakers have proposed closing this gap repeatedly — so check current rules before relying on it.

When harvesting makes sense

Harvesting pays off most clearly in a few situations. You have realized gains this year that you want to offset. You are in a high tax bracket, where each dollar of deducted loss is worth more. Or you rebalanced your portfolio and sold winners, and you have losers sitting around to soften the tax blow.

It is also quietly useful during market dips. A sharp selloff creates unrealized losses across your portfolio even if you are a long-term buy-and-hold investor. Harvesting during those dips banks losses you can use for years, without changing your market exposure. Some investors harvest once a year in December; others check a few times a year when markets wobble. The habit matters more than the timing.

When it is pointless

Honestly, for some people harvesting is a waste of attention. If you have no gains to offset, no taxable income the $3,000 deduction would meaningfully reduce, and you invest only inside retirement accounts, there is nothing to harvest. If your only holdings are in a 401(k) and a Roth IRA, stop reading and go do something else.

It is also pointless if it pushes you into bad investment decisions. Selling a fund you believe in just to realize a loss, then sitting in cash for 31 days "waiting out" the wash-sale window while the market rises — that is the tail wagging the dog. The standard move is to swap into a similar fund immediately, not to sit on the sidelines. Taxes should influence how you invest, not what you invest in.

And keep perspective on the size of the prize. If you harvest $3,000 of excess loss against ordinary income at a 22% bracket, that is $660 in tax savings. Real money, but not life-changing, and not worth paying a financial advisor 1% of your portfolio to capture.

Robo-advisors do this automatically — with limits

Most robo-advisors (Betterment, Wealthfront, and the automated services at big brokerages) offer automatic tax-loss harvesting. Their software scans your account daily, sells positions that dip below their purchase price, and swaps into similar funds — all while watching the wash-sale window. It is genuinely convenient and works as advertised.

The catches are worth knowing. First, it is usually an extra-cost or premium-tier feature, so weigh the fee against the actual tax savings. Second, automation only sees the account it manages. If the robo-advisor sells a fund at a loss in your taxable account while you hold the same fund in your IRA or your spouse holds it in theirs, the wash sale still triggers and the software may never notice. Third, if you use the same funds at two different brokerages, the same blind spot applies.

Common mistakes to avoid

The single most common error is triggering a wash sale across accounts. The rule applies to everything you and your spouse control — your taxable account, your IRA, your spouse's accounts. Buying the same security in your IRA within the window is worse than a normal wash sale: the disallowed loss is added to the basis of shares inside the IRA, where it can never benefit you. That loss is permanently destroyed. Check all your accounts before you harvest.

The second mistake is automatic dividend reinvestment. If a fund pays a dividend within 30 days of your loss sale and the dividend automatically buys new shares, that small purchase can trigger a partial wash sale. Turn off dividend reinvestment for any security you plan to harvest, at least around the sale date.

The third is harvesting in tax-advantaged accounts, where losses are simply irrelevant. And the fourth is mistaking harvested losses for actual returns. Harvesting defers taxes; in many cases it does not eliminate them, because the replacement shares you buy have a lower cost basis, which means a bigger taxable gain when you eventually sell them. It is a timing benefit — often a very good one — but keep the mechanics honest in your head.

One procedural note, since it matters every year: tax rules and brackets shift, and your personal situation determines how much any of this is worth to you. If you are dealing with large amounts, it is worth checking the current IRS rules or running it by a tax professional before you act.

Tax-loss harvesting is one of the rare strategies that is exactly as good as it sounds and no better. It turns the lemons of a down market into a modest, legal tax benefit. Understand the rules, avoid the wash-sale trap, and treat it as maintenance on your portfolio — not a strategy for getting rich.