Young Wise and WealthyYoung Wise. and Wealthy
Investing

Tax-loss harvesting, explained simply

You can turn a losing investment into a tax deduction without changing your plan. Here is how, and the one rule that cancels it.

8 min readFebruary 19, 2026

Tax-loss harvesting turns a losing investment into a tax deduction without changing your plan. You sell something that has dropped below what you paid, which locks in a capital loss on paper. That loss cancels out capital gains you owe tax on, dollar for dollar. Then you buy a similar but not identical fund the same day, so your money stays in the market and keeps tracking the same part of it. You end up with the same investment exposure you had this morning and a tax break you did not have before.

One rule cancels the whole thing if you trip it, and we will get to that. First, the mechanics, because the payoff comes from understanding exactly what a locked-in loss does on your tax return.

What a capital loss actually does

When you sell an investment for less than you paid, the difference is a capital loss. The IRS lets that loss work for you in a fixed order. It offsets your capital gains first, dollar for dollar. If you sold a fund earlier in the year for a $4,000 gain and you harvest a $4,000 loss, the two erase each other and you owe nothing on that gain. Short-term losses net against short-term gains and long-term against long-term first, then any leftover crosses over.

Here is the part most people miss. If your losses are bigger than your gains, or you have no gains at all, up to $3,000 of the leftover loss comes straight off your ordinary income that year. That is the income from your paycheck, taxed at your regular rate. Anything beyond $3,000 does not vanish. It carries forward to next year, and the year after, with no expiration, until you use it all. If you want to see how a deduction changes the tax on your top dollar, check your tax bracket calculator before and after.

Note

The $3,000 ordinary-income limit has not moved in decades and is not indexed to inflation. A married couple filing separately gets half that, $1,500 each. The carryforward, though, has no cap and no clock, so a big loss in a bad market year can shelter gains for many years to come.

The worked example

Say you bought a fund for $20,000 and the market dropped. It is now worth $15,000. You sell it and lock in a $5,000 loss. What happens next depends entirely on whether you have gains to offset.

SituationOffsets gainsDeducts from incomeCarried to next year
You have $5,000 of gains$5,000$0$0
You have $2,000 of gains$2,000$3,000$0
You have no gains$0$3,000$2,000

Walk the no-gains row, because it is the most common. The $5,000 loss has no gains to cancel, so it goes to work on your income. You deduct $3,000 this year, which is the annual ceiling. The remaining $2,000 carries forward. Next year it offsets any gains you have, or knocks another chunk off your income, automatically, as long as your tax software tracks the carryover.

Put a real number on it. If your marginal rate is 22%, deducting $3,000 from ordinary income saves you about $660on this year's tax bill. The $2,000 carryforward is worth roughly another $440 down the line. You did not change your investment plan to get it. You swapped one fund for a near-twin and harvested the paper loss the market handed you.

The wash-sale rule: the one catch

Here is the rule that cancels everything if you ignore it. The IRS wash-sale rule says you cannot claim the loss if you buy the same security, or one that is "substantially identical," within 30 days before or after the sale. That is a 61-day window total: 30 days on each side plus the day of the sale. Break it, and the IRS disallows the loss. It does not disappear forever; it gets added to the cost basis of the replacement shares. But you lose the deduction for this year, which was the entire point.

This is why the move is sell-and-replace, not sell-and-rebuy. If you sell an S&P 500 fund to harvest a loss and buy the exact same S&P 500 fund back the next day, that is a textbook wash sale and the loss is gone. The fix is to buy a different fund that tracks a similar slice of the market. Sell an S&P 500 fund and buy a total US market fund, for example. They hold heavily overlapping companies and move almost in lockstep, but they follow different indexes, so the IRS does not treat them as identical. Your money stays invested in US stocks the whole time. To see how interchangeable broad funds really are, the investing guide walks through what is inside each one.

Watch the whole household

The 30-day window counts purchases anywhere, including your IRA and your spouse's accounts. If you sell a fund at a loss in your brokerage and your automatic contribution buys the same fund in your IRA three days later, you have triggered a wash sale across accounts. Pause any auto-investments in the replacement security around a harvest, and check dividend reinvestment, which counts as a purchase too.

Only in a taxable account

This works in one place: a regular taxable brokerage account. It does nothing inside an IRA or a 401(k), and the reason is simple. Those accounts are already tax-sheltered. You do not pay capital gains tax on sales inside them, so there is no gain to offset and no loss to harvest. A loss inside a Roth IRA is just a smaller balance, with no tax benefit attached. Tax-loss harvesting only means something where the IRS is actually taxing your gains, and that is your taxable brokerage account.

So the candidates are the index funds and ETFs you hold outside retirement accounts. If everything you own is in a 401(k) and a Roth IRA, there is nothing here to do, and that is fine. You are already getting a better tax deal than harvesting could ever provide.

Is it worth your time?

For small amounts, often not. Harvesting a $200 loss saves you maybe $44 at a 22% rate, and you have spent time placing two trades and tracking a carryforward you have to report every year until it clears. The benefit is also partly a loan, not a gift. When you sell the replacement fund years later, its cost basis is lower, so you may owe more gains tax then. The real win is the time value: you keep that $660 working for you now instead of handing it to the IRS, and ideally you sell the replacement decades later at the lower long-term rate.

The move earns its keep on bigger losses, in years the market dropped hard, especially if you have realized gains to cancel. Many robo-advisors and brokerages now harvest automatically across your taxable account, which removes the wash-sale bookkeeping. If you do it by hand, do it deliberately: a real loss, a clean replacement fund, and a calendar note to avoid rebuying inside the window.

FAQ

What is the wash-sale rule?

It is the IRS rule that blocks your loss if you buy the same or a substantially identical security within 30 days before or after the sale, a 61-day window in total. If you trip it, the loss is disallowed for that year and instead gets added to the cost basis of the shares you bought. You avoid it by buying a similar but different fund, like swapping an S&P 500 fund for a total US market fund, so you stay invested without repurchasing the identical security.

Does this work in my 401(k) or IRA?

No. Those accounts are already tax-sheltered, so sales inside them are not taxed and there is no gain to offset or loss to harvest. A drop in your 401(k) or Roth IRA is just a lower balance with no deduction attached. Tax-loss harvesting only helps in a regular taxable brokerage account, where the IRS actually taxes your capital gains.

Is it worth it for small amounts?

Usually not. A $200 loss at a 22% rate saves about $44, which rarely justifies the two trades and the carryforward you then track on every future return. It pays off on larger losses, particularly when you have realized gains to cancel dollar for dollar. If your brokerage or robo-advisor harvests automatically, the bookkeeping is handled for you, so the threshold to bother drops.

What happens to a loss I cannot use this year?

It carries forward with no expiration. After it offsets your gains and the $3,000 ordinary-income limit, the leftover rolls into next year and beyond, offsetting future gains or income until you use it all. A $5,000 loss with no gains, for instance, deducts $3,000 now and carries $2,000 to next year, where it goes back to work automatically.

Go deeper