Selling losers feels like admitting defeat. The tax code disagrees.

Tax-loss harvesting is the process of intentionally selling positions at a loss to realize the tax benefit, then redeploying the capital into a similar position that keeps your portfolio strategy intact. Done carefully and within the rules, it is one of the few legitimate ways to extract real value from a market downturn.

This is a plain-language walkthrough of how it works, the wash-sale rule that can disqualify the loss, and when it makes sense to harvest versus when it does not.

How a realized loss saves you money

The IRS treats investment losses as offsets against investment gains. When you sell a security at a loss, the loss can be applied against capital gains from other sales in the same year. If your losses exceed your gains, up to $3,000 of the net loss can be applied against ordinary income each year. Anything left over carries forward indefinitely to future tax years.

This means a $15,000 realized loss is worth real money. If you have $15,000 of realized gains elsewhere in the same year, the loss erases the tax bill on those gains entirely. If you have no gains, the loss reduces your ordinary income by $3,000 per year for five years, saving roughly $720 a year for someone in the 24% bracket. The leftover loss continues to carry forward until used.

Importantly, this is a real after-tax benefit. The loss has to be realized (the position must be sold), not just floating as paper. Unrealized losses do nothing for your taxes.

The wash-sale rule

The IRS knows that taxpayers would otherwise game the system by selling a loss, immediately rebuying the same security, and claiming the deduction while remaining economically in the position. The wash-sale rule prevents this.

A wash sale occurs when you sell a security at a loss and buy the same or a "substantially identical" security within the 30-day window before or after the sale. The total disallowed window is 61 days: 30 days before, the day of sale, and 30 days after.

When a wash sale happens, you do not get the loss. Instead, the disallowed loss is added to the cost basis of the replacement security. You eventually get the deduction when you sell the replacement, but you cannot claim it now.

"Substantially identical" is the phrase that does the work. The IRS has not provided crisp definitions, but practical guidance is reasonably clear: the exact same ticker is identical. Two ETFs that track the same index (e.g., VTI and ITOT, both total US market) are typically considered substantially identical. Two ETFs that track different indexes (e.g., VTI and VOO, total market versus S&P 500) are typically not.

The wash-sale rule applies across all your accounts, including IRAs. A loss in your taxable account is disallowed if you buy a substantially identical security in your IRA within the 30-day window. This trap surprises many investors.

The workaround

The standard approach is to sell the loss position and immediately buy a similar but not substantially identical security to maintain market exposure during the 30-day wash-sale window.

Specific examples that have been treated as not substantially identical:

  • Sell Vanguard's S&P 500 ETF (VOO), buy Vanguard's Total Stock Market ETF (VTI). Both are broad-equity exposure but track different indexes.
  • Sell SPDR's S&P 500 ETF (SPY), buy iShares' S&P 500 ETF (IVV). Both track the same index but the IRS has not aggressively litigated this case; many practitioners treat them as not substantially identical, though some advisors counsel caution.
  • Sell an individual stock at a loss, buy a sector ETF that includes the stock. Maintains sector exposure without holding the same security.
  • Sell an individual stock at a loss, buy a competitor in the same industry. More aggressive but defensible.

After the 30-day window passes, you can sell the replacement and rebuy the original if you want. The loss is locked in and the wash-sale rule no longer applies.

A worked example

Take an investor who bought 1,000 shares of a stock at $50 in January for $50,000. By October, the stock is at $35 (a $15,000 paper loss). The investor has $20,000 of realized long-term capital gains elsewhere in the year and is in the 24% federal bracket.

If she sells the loss position and immediately rebuys, the loss is disallowed by the wash-sale rule. She gets no current-year tax benefit.

If she sells the loss position and waits 31 days before buying back, she loses the loss recapture if the stock rallies during the gap.

If she sells the loss position and buys a similar-but-not-identical ETF, she keeps roughly the same market exposure for the 30-day window, locks in the $15,000 loss, and applies it against her $20,000 of gains. Her tax bill on those gains drops from $3,000 (at 15% long-term capital gains) to $750. She also still has a $5,000 net loss that carries forward.

That is roughly $2,250 in real tax savings from a single transaction.

When harvesting does not make sense

Tax-loss harvesting is not free. There are costs and limitations.

In retirement accounts, harvesting does nothing. IRAs, 401(k)s, and Roths do not generate taxable gains. There is no loss to claim.

For low-tax-bracket investors, the benefit shrinks. Someone in the 0% long-term capital gains bracket gets no tax benefit from offsetting LTCG. The $3,000 ordinary-income offset still works but at a lower bracket rate.

Small positions are not worth the effort. Below a few hundred dollars in realized loss, the transaction costs, tracking work, and wash-sale risk usually outweigh the benefit.

The position you replace into can underperform during the 30-day window. If you sell a stock at a loss and buy a sector ETF, and the original stock rallies sharply while the ETF lags, you lose more in the rally than you gained in the tax savings.

Year-end harvesting clusters can overload your tax return. Some investors find themselves with so many small lots and wash-sale-adjusted basis figures that the bookkeeping cost exceeds the benefit.

What to actually do

Most disciplined long-term investors review their taxable accounts in late October or November to identify candidates for year-end harvesting. The process is:

  1. Pull every taxable position that is currently held at an unrealized loss.
  2. For each loss, identify a similar-but-not-identical replacement security.
  3. Estimate the tax savings: applies against gains first (at LTCG or STCG rate), then up to $3,000 against ordinary income.
  4. Compare savings to transaction costs (usually near zero at modern brokers) and to the risk of the replacement underperforming during the 30-day window.
  5. Execute the highest-value harvests. Avoid double-counting losses across spouses' accounts.
  6. Wait 31 days, then either keep the replacement or rotate back to the original.

A spreadsheet helps. So does a broker statement that flags wash sales automatically.

The disclaimer

This is educational content, not tax or investment advice. The wash-sale rule has edge cases and the IRS has discretion in applying "substantially identical." Tax laws change. Before harvesting losses meaningfully, consult a tax professional. For investors with significant taxable assets, the cumulative annual value of disciplined harvesting can be substantial, often more than the cost of professional tax planning.