A concrete example of tax loss harvesting

Tax loss harvesting means selling an investment at a loss to offset gains you made elsewhere. Here's how it works in practice: suppose you bought 100 shares of Stock A for $5,000 six months ago. The price dropped and those shares are now worth $3,500. At the same time, you sold Stock B earlier this year and made a $2,000 gain on it. If you sell Stock A now, you lock in a $1,500 loss. That loss can cancel out your $2,000 gain from Stock B, leaving you with only $500 in taxable gains instead of $2,000.

The mechanics are straightforward: you own the losing position, you sell it, and you use the loss on your tax return. The IRS lets you deduct investment losses against investment gains dollar-for-dollar. If your losses exceed your gains in a year, you can deduct up to $3,000 of the excess against ordinary income (like wages or salary). Any losses beyond that carry forward to future years.

The catch is the wash-sale rule. If you sell Stock A for a loss and then buy it back (or buy something "substantially identical") within 30 days before or after the sale, the IRS disallows the loss. You can't harvest the loss and keep the same position. You have to either stay out of that investment for 30 days or switch to a similar but different investment.

Key Takeaways

  • You sell a losing investment to lock in the loss, then use that loss to offset investment gains you made during the year.
  • Losses can cancel gains dollar-for-dollar, and any remaining losses can reduce your ordinary income by up to $3,000 per year.
  • The wash-sale rule blocks you from buying back the same or substantially identical investment within 30 days of the sale.
  • Tax loss harvesting only saves money if you have gains to offset or ordinary income to reduce; a loss with no gains produces no tax benefit that year.

When tax loss harvesting actually saves you money

Tax loss harvesting only produces a tax benefit if you have something to offset. If you sold investments at a gain this year, losses will reduce what you owe. If you have no gains, losses can still help—you can deduct up to $3,000 against your regular income (wages, salary, interest). But if you have no gains and your income is below $3,000 in losses, the excess loss carries to next year and the year after that.

The real value appears when you have both gains and losses in the same year. Suppose you made $5,000 in gains and harvested $3,000 in losses. You now owe tax on $2,000 instead of $5,000. If your tax rate is 20%, you save $600 in taxes. That $600 stays in your pocket instead of going to the IRS.

A multi-year example with carryover losses

Tax loss harvesting can span years. Imagine Year 1: you harvest $8,000 in losses but have only $2,000 in gains. You deduct $2,000 of losses against the gains (now zero taxable gains) and $3,000 against ordinary income. That leaves $3,000 in losses carried forward to Year 2.

In Year 2, you make $1,500 in new gains and harvest another $2,000 in losses. Your $3,000 carryover plus the new $2,000 loss gives you $5,000 total. You use $1,500 to offset the new gains and $3,000 against ordinary income. You still have $500 left to carry to Year 3. This process continues until the losses are used up or you run out of years.

The wash-sale rule and how to avoid it

The wash-sale rule is where most people stumble. If you sell a stock for a loss on December 15, you cannot buy that same stock again until January 15 (30 days later). If you do, the IRS disallows the loss retroactively. The cost basis of the new shares gets adjusted upward by the disallowed loss, which just delays the tax benefit.

The rule also covers "substantially identical" securities. If you sell a stock fund for a loss, you can't when ready buy a nearly identical stock fund tracking the same index. But you can switch to a different fund with a similar strategy—for example, selling a large-cap growth fund and buying a large-cap value fund. The IRS considers these different enough. Your broker or tax software can flag wash-sale violations, but the burden is on you to track it.

Why investors harvest losses in December

Most tax loss harvesting happens in November and December because the tax year ends December 31. If you realize you have gains you want to offset, you have a narrow window to sell losing positions and lock in the loss for that year. After December 31, any losses you harvest belong to the next tax year.

This timing pressure is why tax loss harvesting is often called a year-end strategy. Some investors review their portfolio in October or November, identify positions underwater, and decide whether selling makes sense. If you wait until January, you've missed the chance to use those losses against this year's gains.

What happens if you harvest a loss but the investment rebounds

Once you sell at a loss, you've locked in that loss for tax purposes. If the investment price rises after you sell, you don't get the loss back—you've already claimed it. The upside is that you can now buy back into the investment (after 30 days) at the new, lower price, and any future gains start fresh from that point.

This is why tax loss harvesting involves a trade-off. You get an when ready tax benefit, but you give up the chance to recover the loss if the investment bounces back quickly. Some investors decide the tax savings are worth it; others prefer to hold and wait for a recovery. There's no universally right answer—it depends on your tax situation and your outlook for the investment.

Harvesting losses in taxable and retirement accounts

Tax loss harvesting only works in taxable brokerage accounts. In a 401(k), IRA, or other retirement account, you can't harvest losses because those accounts don't produce taxable gains or losses in the first place. The IRS doesn't tax the gains inside a retirement account until you withdraw the money (or never, in the case of a Roth). Since there's no annual tax bill, there's nothing to offset.

This is why tax loss harvesting is a strategy for people with money in both taxable and retirement accounts. If all your investments are in an IRA, tax loss harvesting doesn't explore to you. If you have a mix, you focus on the taxable account and ignore the retirement accounts for this purpose.

Frequently Asked Questions

Can I harvest a loss and buy the same stock back after 30 days?

Yes. After 30 days have passed since the sale, you can buy back the same stock without triggering the wash-sale rule. The loss remains valid. Many investors do this—they harvest the loss in December, stay out of the position for 30 days, and buy back in late January or February.

What if I have more losses than gains in a year?

You can deduct up to $3,000 of excess losses against your ordinary income (wages, salary, interest). Any losses beyond $3,000 carry forward to the next year. This carryover continues indefinitely, so you don't lose the losses—you just use them over time.

Do I have to report tax loss harvesting to the IRS?

You report it on Schedule D (Capital Gains and Losses) when you file your tax return. Your broker sends you a 1099-B form listing all your sales. The IRS doesn't require a separate "tax loss harvesting" form—it's just part of your normal capital gains and losses reporting.

Can I harvest losses in my spouse's account to offset my gains?

No. Losses can only offset gains and income in the account where they occurred. If your spouse has losses and you have gains, your spouse can use their losses to reduce their own tax bill, but not yours. You each file separately and report your own gains and losses.

What if I sell a mutual fund for a loss and buy a different fund in the same category?

It depends on how different the funds are. If both track the same index or have nearly identical holdings, the IRS may consider them substantially identical and disallow the loss. If one is a growth fund and the other is a value fund, or if they track different indexes, they're usually considered different enough. Your tax software or broker can help you assess this.