Tax BasicsLesson 3

Tax-Loss Harvesting

Turn investment losses into real tax savings.

8 min read
Beginner
Sean ShaReviewed by Sean Sha
Updated: February 2026

Educational purposes only. This content does not constitute investment advice. Read our disclaimer

StockCram is not a broker-dealer, investment adviser, or financial institution. All content is for educational and informational purposes only and should not be construed as personalized investment advice. Consult a qualified financial professional before making investment decisions. Past performance does not guarantee future results.

TL;DR

Tax-loss harvesting means selling investments at a loss to offset capital gains and reduce taxes. Losses first offset gains dollar-for-dollar. Remaining losses can offset up to $3,000 of ordinary income per year, with unused losses carrying forward indefinitely. Watch out for the wash sale rule - don't buy back the same security within 30 days.

What Is Tax-Loss Harvesting?

Tax-loss harvesting is a strategy where you intentionally sell investments at a loss to reduce your tax bill. It's one of the few "silver linings" when investments decline - you can use those losses to offset capital gains elsewhere.

Think of it like this: if you had a $5,000 gain and a $5,000 loss in the same year, you could "harvest" that loss to completely offset the gain, owing zero capital gains tax.

Key insight: Tax-loss harvesting doesn't make losses "good" - you still lost money. But it does let you reduce your tax bill, which softens the blow. It's about making the best of a bad situation.

How Tax-Loss Harvesting Works

When you sell an investment at a loss, that loss can reduce your taxes in two ways:

1. Offset Capital Gains

Losses offset gains dollar-for-dollar. Short-term losses first offset short-term gains, then long-term gains. Long-term losses offset long-term gains first, then short-term.

Example: $8,000 gain + $5,000 loss = $3,000 net gain (taxed)

2. Deduct From Ordinary Income

If losses exceed gains, you can deduct up to $3,000 of net capital losses against ordinary income (like your salary). Any excess carries forward to future years.

Example: $2,000 gain + $10,000 loss = $8,000 net loss. Deduct $3,000 this year, carry $5,000 forward.

Taxable accounts only:

Tax-loss harvesting only works in taxable brokerage accounts. In tax-advantaged accounts (401(k), IRA), gains and losses aren't taxed annually, so there's nothing to harvest.

The Wash Sale Rule

There's a catch. The IRS doesn't want you to sell just to claim a loss and immediately buy back the same investment. The wash sale rule prevents this.

The 30-Day Rule:

You cannot claim a tax loss if you buy the same or substantially identical security within 30 days before or after the sale. That's a 61-day window total (30 days before + sale day + 30 days after).

If you trigger a wash sale, your loss isn't lost forever - it gets added to the cost basis of your replacement shares. But you can't claim it now.

Triggers Wash Sale?Action
YesBuy same stock within 30 days
YesBuy same ETF within 30 days
MaybeBuy similar ETF from different provider
NoWait 31+ days to repurchase

Step-by-Step Tax-Loss Harvesting

1

Identify investments with losses

Review your portfolio for positions trading below your cost basis.

2

Consider if selling makes sense

Do you still believe in the investment? Would you buy it again at this price?

3

Sell to realize the loss

Execute the sale. The loss is now realized and can offset gains.

4

Reinvest in something similar (optional)

To stay invested, buy a similar but not identical investment to avoid the wash sale rule. For example, if you sell VTI (Vanguard Total Stock Market), you could buy SCHB (Schwab Broad Market) or ITOT (iShares Core S&P Total). They track similar indexes but are not "substantially identical."

5

Track for your tax return

Your broker reports sales on Form 1099-B. Report capital gains/losses on Schedule D.

When to Harvest Losses

Tax-loss harvesting is most valuable when:

  • You have significant capital gains to offset
  • You're in a high tax bracket (more benefit from deductions)
  • It's late in the year and you know your tax situation
  • Markets have declined, creating loss opportunities
  • You want to rebalance anyway

Year-end note: Many investors harvest losses in December to offset gains from the year. But you can harvest anytime. If the market drops 20% in March and you have losses, you don't have to wait until December.

Note: Tax-loss harvesting defers taxes rather than eliminating them. When you eventually sell the replacement investment, your gains will be calculated from the new (lower) cost basis. Consult a tax professional to understand if this strategy makes sense for your situation.

Now you understand how to turn investment losses into tax savings. Next, we'll look at how dividends are taxed differently.

Key Takeaways

  • Losses offset gains dollar-for-dollar - $5,000 in losses can eliminate taxes on $5,000 in gains.
  • Deduct up to $3,000 against ordinary income - Excess losses can reduce your regular income taxes each year.
  • Unused losses carry forward - No limit on carrying losses to future tax years.
  • Watch the wash sale rule - Don't buy back the same security within 30 days or you lose the deduction.

Continue Learning

Frequently Asked Questions

The wash sale rule prevents you from claiming a tax loss if you buy the same or a "substantially identical" security within 30 days before or after selling at a loss. If triggered, your loss is disallowed and added to the cost basis of the replacement shares.

Capital losses first offset capital gains dollar-for-dollar. If you have net losses remaining, you can deduct up to $3,000 per year ($1,500 if married filing separately) against ordinary income. Unused losses carry forward to future years indefinitely.

Yes, you can buy a similar but not "substantially identical" investment. For example, selling one S&P 500 ETF and buying a different S&P 500 ETF from another provider may work, but consult a tax professional. The IRS doesn't precisely define "substantially identical."

It depends on your tax situation. The benefit is deferring taxes (not eliminating them) and potentially converting short-term gains to long-term gains. For large portfolios or high earners, the savings can be significant. Many robo-advisors do this automatically.

Share