Tax loss harvesting is selling an investment at a loss to offset gains you made elsewhere

When you sell an investment for less than you paid for it, you create a capital loss. The IRS lets you use that loss to reduce the taxes you owe on capital gains — the profits from investments you sold at a higher price. Tax loss harvesting is the deliberate practice of realizing losses in your portfolio so you can use them to lower your tax bill. It is not a deduction or a credit; it is a way to reduce the actual amount of gain the government taxes you on.

The mechanics are straightforward: you own a stock or fund that has dropped in value since you bought it. You sell it. That sale locks in the loss. You can then use that loss to cancel out gains from other sales during the same year, or carry the loss forward to future years if you do not have enough gains to offset this year. The result is a smaller tax bill on your investment income.

Key Takeaways

  • A capital loss from selling an investment at a loss can reduce the capital gains you owe taxes on, dollar for dollar, in the same year or future years.
  • If your losses exceed your gains in a year, you can deduct up to $3,000 of the excess loss against ordinary income like wages, with any remainder carried forward indefinitely.
  • The wash-sale rule prevents you from buying the same or substantially identical security within 30 days before or after the sale, or the loss will not count.
  • Tax loss harvesting works best for taxable accounts (not retirement accounts like 401(k)s or IRAs, where gains and losses do not affect your taxes).
  • The strategy is most valuable if you have significant capital gains in a year or if you are in a high tax bracket where each dollar of deduction saves more in taxes.

How capital losses offset capital gains

The IRS treats capital gains and capital losses as a matched pair. If you sold Stock A for a $5,000 profit and Stock B for a $3,000 loss in the same year, your net capital gain is $2,000. You pay tax only on that $2,000, not on the full $5,000 gain. The loss directly reduces the gain, and you owe tax on the difference.

This is different from a deduction, which reduces your taxable income. A capital loss reduces the amount of gain you are taxed on. The distinction matters because capital gains are often taxed at a lower rate than ordinary income. If you have a $5,000 long-term capital gain taxed at 15 percent, that is $750 in tax. A $3,000 loss reduces it to $2,000 in gain and $300 in tax — you save $450.

What happens when losses exceed gains

Some years you may have more losses than gains. If your capital losses are larger than your capital gains, you can use the excess to reduce your ordinary income — wages, salary, interest, or other non-investment income — by up to $3,000 per year. This is a real deduction from your taxable income, not just an offset to gains.

If your losses are even larger than that, you do not lose the rest. Any loss beyond the $3,000 annual limit carries forward to the next year, and the next, indefinitely. You can use it whenever you have gains to offset, or chip away at it $3,000 per year against ordinary income. This is why tax loss harvesting can be valuable even in years when you have no gains — you are building a loss carryforward that will reduce taxes in future years.

The wash-sale rule and why it matters

The IRS has one major restriction on tax loss harvesting: the wash-sale rule. If you sell a security at a loss, you cannot buy that same security or a substantially identical one within 30 days before the sale or 61 days after it. If you do, the loss is disallowed — it does not count for tax purposes, and the cost basis of the new purchase is adjusted instead.

The 30-day window before the sale is often overlooked. If you sold a stock on December 15 at a loss, you cannot have bought that same stock on or after November 15. The window is 30 days before, the sale date, and 61 days after — a total of 92 days during which you cannot own the security.

"Substantially identical" is broader than the exact same stock. Buying the same company's stock in a different share class, or buying a fund that holds mostly the same holdings, can trigger the rule. If you own a fund that tracks the S&P 500 and sell it at a loss, buying a different S&P 500 fund within the window will likely violate the rule. The IRS has not published a precise definition, so advisors often recommend waiting the full 61 days or switching to a genuinely different investment.

Why tax loss harvesting works best in taxable accounts

Tax loss harvesting only matters in taxable accounts — regular brokerage accounts where you report gains and losses to the IRS. In retirement accounts like 401(k)s, traditional IRAs, or Roth IRAs, you do not report gains or losses when you sell. The account grows tax-deferred or tax-free, and you do not owe tax on the sale itself. Harvesting losses in those accounts has no tax benefit because there is no tax to reduce.

This is why the strategy is most common among people with significant investments outside retirement accounts. If most of your portfolio is in a 401(k) or IRA, tax loss harvesting will not help much. If you have a large taxable brokerage account, it becomes more valuable.

When tax loss harvesting saves the most money

The tax savings from harvesting depend on two things: how much gain you have to offset, and what tax rate applies to that gain.

If you have no capital gains in a year, harvesting losses is still useful — you can deduct $3,000 against ordinary income. But the value is smaller. If you are in the 24 percent federal tax bracket, a $3,000 deduction saves $720 in federal tax. If you have $10,000 in long-term capital gains taxed at 15 percent, a $3,000 loss saves $450 in federal tax.

The strategy is most valuable when you have significant gains to offset and you are in a higher tax bracket. Someone in the 37 percent bracket with $50,000 in long-term gains (taxed at 20 percent) can save thousands by harvesting losses. Someone with no gains and modest income saves less. The math changes by state too — states with capital gains taxes or high income taxes increase the value of each dollar of loss.

Common mistakes and limitations

The most common mistake is forgetting the wash-sale rule and buying back the same investment too soon. The loss disappears, and you have no tax benefit. Some people also harvest losses but then do not actually use them — they let the carryforward sit unused for years. While the loss never expires, it only helps when you have gains or ordinary income to offset.

Another limitation is that tax loss harvesting does not change the underlying value of your portfolio. You are selling a losing investment and buying something else. If the investment you sell later recovers and the replacement does not, you have locked in a loss and missed the recovery. The strategy assumes you are comfortable with that trade-off in exchange for a lower tax bill now.

Finally, tax loss harvesting is most useful for active investors who buy and sell regularly. If you buy and hold the same funds for decades, you may never have losses to harvest, or you may harvest them only once near the end. For buy-and-hold investors, the tax benefit is smaller than for people who rebalance or trade more frequently.

Frequently Asked Questions

Can I harvest losses in a Roth IRA or 401(k)?

No. Losses in retirement accounts do not count for tax purposes because you do not report gains or losses when you sell inside the account. Tax loss harvesting only works in taxable brokerage accounts where you report capital gains and losses to the IRS.

What if I sell a stock at a loss and buy it back after 61 days?

The loss counts. The wash-sale rule is 30 days before the sale, the sale date itself, and 61 days after — a total of 92 days. If you buy back on day 92 or later, the loss is allowed. Many advisors recommend waiting the full 61 days after the sale to be safe.

Can I use capital losses to reduce my salary or wages?

Only up to $3,000 per year. If your capital losses exceed your capital gains by more than $3,000, you can deduct $3,000 of the excess against ordinary income like wages. Any loss beyond that carries forward to future years, where you can use it the same way.

Does tax loss harvesting work if I am in a low tax bracket?

Yes, but the savings are smaller. A $3,000 loss deducted against ordinary income saves $360 in federal tax if you are in the 12 percent bracket, versus $720 if you are in the 24 percent bracket. The strategy still reduces your tax bill, but the benefit is less dramatic.

What counts as a substantially identical security under the wash-sale rule?

The IRS has not published a precise definition. Generally, the same stock or fund is clearly identical. Buying a different share class of the same company, or a different fund tracking the same index, is risky and may trigger the rule. When in doubt, switching to a genuinely different investment or waiting 61 days is safer.