Every November and December, some investors sell their losing positions on purpose. It is not panic: it is tax-loss harvesting, a way to turn paper losses into a lower tax bill. Done carelessly, though, it can run into the wash sale rule and cancel the benefit. This guide covers the US rules; other countries have similar ones, such as Canada’s superficial loss rule.
How tax-loss harvesting works
When you sell an investment for less than you paid, you realize a capital loss. In the US, those losses first offset capital gains from other sales in the same year. If losses exceed gains, up to $3,000 of the remainder can offset ordinary income each year, and anything left carries forward to future years with no expiry.
A simple example: you sold one stock for a $5,000 gain this year, and another holding is down $4,000. Selling the loser before December 31 reduces your taxable gain to $1,000.
- Short-term losses (held one year or less) offset short-term gains first, which are taxed at higher ordinary rates.
- Long-term losses offset long-term gains first.
The wash sale rule
The IRS does not let you sell for a loss and immediately buy the same thing back. If you buy the same or a “substantially identical” security within 30 days before or after the sale, a 61-day window in total, the loss is disallowed for now.
| Scenario | Wash sale? |
|---|---|
| Sell a stock, buy it back 10 days later | Yes |
| Buy more shares 2 weeks before selling the original lot at a loss | Yes |
| Sell in a taxable account, buy the same fund in your IRA | Yes |
| Automatic dividend reinvestment buys shares within the window | Yes, for those shares |
| Sell one company, buy a different company in the same industry | No |
| Wait 31 days, then buy back | No |
A disallowed loss is not gone. It is added to the cost basis of the replacement shares, which reduces your gain (or increases your loss) when you eventually sell them. But the benefit is delayed, and in the IRA case it can be lost permanently. Turn off dividend reinvestment on a position you plan to harvest.

Staying invested while harvesting
The main downside of waiting 31 days is missing a rebound. Many investors instead buy a similar but not identical investment, such as a different company in the same sector or a fund tracking a different index. Whether two funds are “substantially identical” is not precisely defined, so funds tracking the exact same index are generally treated as risky swaps.
When harvesting does not help
- Inside IRAs, 401(k)s, and other tax-advantaged accounts, where gains and losses are not taxed each year.
- When the loss is tiny and trading costs or spreads would eat it. Our guide to order types helps limit that cost.
- When you would sell a long-term holding you still believe in and cannot find a reasonable substitute.
What this means for you
A year-end harvesting checklist:
- List taxable-account positions trading below your cost.
- Check purchases in the 30 days before, and plan none for 30 days after, across all accounts including IRAs.
- Pause automatic reinvestment on those positions.
- Place trades well before the last trading day of the year.
- Confirm the details with a tax professional for your situation.
The bottom line
Tax-loss harvesting turns investment losses into tax savings by offsetting gains and up to $3,000 of income a year. The wash sale rule is the main trap: avoid buying the same or a substantially identical investment for 30 days on either side of the sale, in any account. This article is for education only and is not tax or investment advice.



