Tax-loss harvesting, and the wash-sale rule

Level 6Taxes6 min read

This is for anyone with investments in a regular taxable brokerage account. Losses are never fun, but when an investment drops below what you paid, you can sometimes turn that loss into a lower tax bill without changing your overall plan.

1. What it is

Tax-loss harvesting means selling an investment that's worth less than you paid, so the loss is "realized" for tax purposes, then buying something similar so you stay invested. The realized loss can offset capital gains, and if losses exceed gains, up to $3,000 a year ($1,500 if married filing separately) can offset ordinary income like your salary. Anything left over carries forward to future years with no expiration.

2. A worked example

Say earlier this year you sold some stock and realized a $5,000 long-term gain. You also own a stock index fund you bought for $30,000 that's now worth $22,000, an $8,000 paper loss. You sell the fund and immediately buy a different, broadly similar fund with the $22,000.

  • $5,000 of the loss cancels the gain. At a 15% long-term rate, that saves about $750.00.
  • The next $3,000 offsets salary. In the 24% bracket, that's about $720.00.
  • Your total tax savings this year come to roughly $1,470.00, and you still own about the same slice of the market.

The order matters a little: short-term losses first offset short-term gains, long-term losses offset long-term gains, and then any remainder crosses over. Tax software or your tax preparer handles that netting.

3. The wash-sale rule

The IRS doesn't let you sell for a loss and buy right 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. It isn't gone forever in a normal account. It gets added to the cost basis of the shares you bought, so you get the benefit later when you sell those.

Common ways people trip it by accident:

  • Dividend reinvestment or automatic investing buys a few shares of the same fund within the window.
  • Buying in an IRA or Roth IRA. If the replacement purchase happens in your retirement account, the loss is generally lost for good, since there's no basis to add it to.
  • Your spouse buys it. Purchases in a spouse's account count too.
  • Buying shortly before the sale. The window runs 30 days in both directions.

4. What counts as substantially identical

The same stock or the same fund clearly does. Shares of two different companies clearly don't. Funds are the gray area. Many investors switch to a fund that tracks a different index, such as from an S&P 500 fund to a total U.S. market fund, which behaves very similarly but follows a different list. Two funds tracking the exact same index from different companies are a closer call, and the IRS hasn't drawn a bright line.

5. You're deferring tax, mostly

Harvesting lowers the cost basis of what you own. In the example, the new fund's basis is $22,000 instead of $30,000. If you later sell it for $40,000, your gain is $18,000 instead of $10,000. So part of the benefit is timing: tax saved today, more tax owed later. It can still come out well ahead because:

  • Losses that offset ordinary income at 24% may later come back as long-term gains taxed at 15% or even 0%.
  • Money saved now can be invested and grow in the meantime.
  • Investments held until death generally get a stepped-up basis for heirs, and donating appreciated shares to charity avoids the gain entirely.

6. When it doesn't help much

It doesn't apply inside IRAs or 401(k)s, where gains and losses aren't taxed. If your income is low enough that your long-term gains are taxed at 0%, harvesting losses saves little, and some people do the opposite, selling winners to reset a higher basis tax-free. Small losses may not be worth the paperwork. And it should never push you into an investment you wouldn't otherwise want to own.

Keeping your cost basis up to date in Notch's Portfolio makes it easier to spot holdings sitting below what you paid. Check your brokerage's realized gains report before December to see where you stand for the year.

The takeaway: Sell the loser, buy something similar but different, and stay out of the 61-day wash-sale window across every account in your household. Done carefully, it trims this year's tax bill without changing your plan.

Education only, not tax, investment or legal advice. Contribution limits and tax rules change every year, so check IRS.gov or talk with a tax professional before acting.