What Is Tax-Loss Harvesting, Simply Explained

October 16, 2026 · 6 min read · Money basics

It is December, and one of your funds is down $2,000. You have two choices: hold it and hope, or sell it, lock in the loss, and turn that loser into a tax deduction. The second choice has a name, tax-loss harvesting, and it is one of the few genuinely free moves in personal finance. The catch is that the IRS saw this coming decades ago and wrote a rule to keep you honest. Here is the whole thing in plain English.

The idea is simple. A loss only counts when you sell. While the fund sits in your account down $2,000, that is a paper loss and the IRS does not care. The moment you sell, the loss becomes real, a realized capital loss, and the tax code lets you use it. First it offsets any capital gains you made this year, dollar for dollar. If your losses are bigger than your gains, you can use up to $3,000 of the leftover loss against ordinary income like wages, and anything beyond that carries forward to next year. So that $2,000 loss: if it offsets $2,000 of gains you would have been taxed at 15%, you just saved $300. Real money, from a position you were losing on anyway.

Sorting out your accounts? Browse the free calculators in The Tool Directory for retirement, tax, and budgeting help.

What is tax-loss harvesting, step by step?

Say you bought 100 shares of a fund at $50, $5,000 total, and it fell to $30. You sell everything for $3,000 and realize a $2,000 loss. Elsewhere this year you sold some winners for a $2,000 gain. The loss cancels the gain. Without harvesting, you would owe tax on that $2,000 of gains; with it, you owe nothing on those gains, and you still have the $3,000 in cash from the sale to reinvest.

Two things make this work cleanly. First, it only applies in taxable brokerage accounts. Selling at a loss inside an IRA or 401(k) creates no deduction, because those accounts are already tax sheltered. Second, you do not have to sit in cash. After selling, you can immediately buy a similar but not identical investment, one broad-market index fund swapped for a comparable fund tracking a different index, and keep your market exposure almost unchanged. This is what the pros do: same posture, harvested loss.

The wash-sale rule: the 61-day trap

Now the part that ruins it for beginners. The IRS will not let you claim a loss on a sale while effectively keeping the same investment. Under the wash-sale rule, Section 1091 of the tax code, if you sell at a loss and buy a substantially identical security within 30 days before or after the sale, the loss is disallowed. That is a 61-day window: 30 days before, the sale day, 30 days after. Buy the same fund back two weeks later because you miss it, and your harvested loss is gone for this year.

The disallowed loss is not destroyed. It gets added to the cost basis of the replacement shares, so you will eventually get the benefit when you sell those. But tax-loss harvesting is a timing game, and a wash sale defeats the timing. Worse, the rule looks across all your accounts, not just the one you sold in. Buy the same fund in your IRA within the window and the loss is permanently disallowed, because basis adjustments inside an IRA buy you nothing. Automatic dividend reinvestments count too, which is the way most people trigger this by accident.

I know how this sounds: a rule that punishes you for buying back something you believe in. But the line is narrower than it feels. Swapping one S&P 500 index fund for another company's S&P 500 fund can still trigger it, since the holdings overlap heavily. Swapping an S&P 500 fund for a total-market fund with a different index is the standard safe move. When in doubt, wait the full 31 days. A month of sitting out is cheaper than a disallowed loss.

When it is worth doing

Tax-loss harvesting earns its keep when you have gains to offset, a big down year in part of your portfolio, or a brokerage account you are actively managing. It is less interesting in years with no gains, though the $3,000-a-year ordinary income offset and the carryforward still make it worth the paperwork. It is also a December ritual for a reason: by year end you know your gains and can harvest precisely enough to cover them.

The honest limit: this is tax deferral, not tax elimination. When you sell the replacement investment later at a higher price, that old basis adjustment means a bigger gain. You pushed the tax into the future, ideally into a year with a lower rate. That is still a win, but do not let anyone sell it to you as free money with no bill ever. It is free money now, with a smaller bill later, which is a trade most people should take.

Tax-loss harvesting questions

What is tax-loss harvesting, simply explained?

Tax-loss harvesting means selling an investment that has lost value so you can use the realized loss to offset capital gains and reduce your tax bill. It only works on losses you actually realize by selling, in taxable brokerage accounts.

What is the wash-sale rule?

The wash-sale rule (IRC Section 1091) disallows a tax loss if you buy a substantially identical security within 30 days before or after selling at a loss, a 61-day window. The disallowed loss is added to the cost basis of the replacement shares, deferring the benefit.

How much can tax-loss harvesting save?

Capital losses offset capital gains dollar for dollar, plus up to $3,000 of ordinary income per year, with the rest carried forward. A $2,000 loss offsetting gains taxed at 15% saves $300.

Can I buy the stock back after harvesting a loss?

Yes, after 31 days. Or immediately buy a similar but not substantially identical investment, like swapping one broad index fund for a comparable fund tracking a different index, to stay invested while avoiding the wash-sale rule.

Does tax-loss harvesting work in retirement accounts?

No. It only works in taxable brokerage accounts. Selling at a loss inside an IRA or 401(k) creates no tax benefit, and buying the same security in an IRA within the wash-sale window can permanently disallow the loss.