GetHossa

Taxes

Tax-loss harvesting and the wash-sale rule

Sell losers to cut your tax bill without leaving the market, and avoid the wash-sale rule: how losses offset gains, the $3,000 limit and IRA traps.

By Published 14 Oct 2026Updated 20 Oct 20265 min read

A losing position hurts, but in a taxable brokerage account it can still be useful. Sell it, and the realized loss offsets capital gains — and up to $3,000 a year of your ordinary income. Buy something similar, and you stay invested. That's tax-loss harvesting. The catch is the wash-sale rule, which cancels the loss if you buy the same thing back too soon.

Here is how it works, with numbers, and the traps that catch even experienced investors.

How capital losses reduce your tax

When you sell an investment for less than you paid, you realize a capital loss. The tax code sorts gains and losses by holding period:

  • Short-term: held one year or less. Net short-term gains are taxed at your ordinary income rate.
  • Long-term: held more than one year. Net long-term gains are taxed at 0%, 15% or 20%.

Losses first offset gains of the same type, then the other type. If you end the year with a net loss, you can deduct up to $3,000 of it from ordinary income ($1,500 if married filing separately). Anything above that carries forward to future years, indefinitely, until it's used up.

Example: harvesting a loss

In March you bought 100 shares of a stock at $80 ($8,000). By November they're worth $60. Earlier in the year you sold another stock for a $5,000 long-term gain.

You sell the 100 shares for $6,000 and realize a $2,000 short-term loss. It offsets part of the gain, so you pay long-term capital gains tax on $3,000 instead of $5,000. At the 15% rate that saves $300 this year.

With no gains to offset, the $2,000 would be deducted from ordinary income instead. In the 22% bracket that's worth $440.

Right after the sale you buy a different fund or stock with similar exposure, so you don't miss a rebound while you wait.

The wash-sale rule

You can't sell at a loss and immediately buy the same thing back. If you buy substantially identical stock or securities within 30 days before or after the sale — a 61-day window — the loss is disallowed for now.

It isn't gone forever (with one important exception, below). The disallowed loss is added to the cost basis of the replacement shares, and their holding period includes the time you held the shares you sold.

Example: a wash sale

Continuing the example: twenty days after selling at $60, you buy the same 100 shares back at $62 ($6,200). That's a wash sale.

  • The $2,000 loss is disallowed this year.
  • Your new shares' basis is $6,200 + $2,000 = $8,200.
  • If you later sell them at $90 ($9,000), your gain is $800 instead of $2,800.

You recover the loss eventually, but you lose this year's deduction, which was the point.

What counts as a purchase

  • Buys in any of your accounts, including other brokerages. Your broker reports wash sales on Form 1099-B only for identical securities in the same account; across accounts it's up to you.
  • Your spouse's purchases of the same security.
  • Your IRA or Roth IRA. This is the worst case: under IRS Revenue Ruling 2008-5, a loss disallowed because the replacement was bought in an IRA does not increase the IRA's basis. The loss is lost for good.
  • Automatic dividend reinvestment. A small reinvestment within the window creates a partial wash sale. Turn off reinvestment on positions you plan to harvest.
  • Options to buy the same stock, such as call options bought within the window.

What "substantially identical" means

The IRS has never defined it precisely. Shares of two different companies aren't substantially identical, even in the same industry. Swapping one S&P 500 fund for another S&P 500 fund from a different provider is a grey area. Many investors swap into a fund that tracks a different index — say, from an S&P 500 fund to a total US market fund — which keeps similar exposure with much less ambiguity.

When harvesting isn't worth it

  • You're in the 0% long-term bracket. If your gains would be taxed at 0% anyway, harvesting losses against them saves nothing; you may prefer to realize gains instead.
  • The loss is small. Trading costs, bid-ask spreads and the bookkeeping may exceed the benefit.
  • It's a deferral, not a gift. A lower basis means a bigger gain later. The benefit is real when the later gain is taxed at a lower rate, is never taxed (shares inherited with a stepped-up basis, or donated), or simply because a dollar of tax saved today can be invested for years.
  • The replacement isn't really equivalent. If you swap a stock for something with different risk, you've changed your portfolio, not just your taxes.

A harvesting checklist

  1. Look for positions with a loss in taxable accounts only — losses inside IRAs and 401(k)s don't count.
  2. Check every account (and your spouse's) for purchases of the same security in the past 30 days.
  3. Turn off dividend reinvestment for that security.
  4. Sell, and buy a replacement that isn't substantially identical.
  5. Don't buy the original back for 31 days, in any account.
  6. Keep records: your broker's 1099-B, and your own notes for cross-account wash sales, feed Form 8949 and Schedule D.

Seeing your losses at a glance

To harvest, you first need to know where your losses are — and which lots a sale will use (see cost basis methods). GetHossa shows each holding's result since purchase, every closed position matched to its purchases first-in-first-out, and how each position did against the S&P 500 over the same days. It doesn't replace your broker's tax forms or flag wash sales — check those yourself before selling.

Related: how qualified and ordinary dividends are taxed.

This article is for educational purposes only and is not tax advice. For decisions about your return, consult a tax professional.

Frequently asked questions

What is the wash-sale rule?+

If you sell a security at a loss and buy the same or a substantially identical security within 30 days before or after the sale, the loss is disallowed for that year. It is added to the cost basis of the replacement shares instead.

How much capital loss can I deduct per year?+

Losses first offset capital gains without limit. A remaining net loss can reduce ordinary income by up to $3,000 a year ($1,500 if married filing separately); the rest carries forward to future years.

Does buying in my IRA trigger a wash sale?+

Yes. Buying the same security in an IRA or Roth IRA within the 61-day window triggers a wash sale, and under Revenue Ruling 2008-5 the disallowed loss doesn't increase the IRA's basis — it is permanently lost.

Can I buy a similar ETF after tax-loss harvesting?+

Yes, as long as it isn't substantially identical. Many investors switch to a fund tracking a different index, for example from an S&P 500 fund to a total US stock market fund.

Is tax-loss harvesting worth it?+

It helps most when you have gains taxed at 15% or more, or when you can use the $3,000 deduction against ordinary income. It mainly defers tax, so the benefit depends on your future tax rates and how long you hold the replacement.

Sources

This article is for information and education only. It isn't investment or tax advice. Rules and broker practices change — check the current rules or talk to a tax advisor.

See your portfolio next to the S&P 500

Import your Interactive Brokers history or add trades by hand — GetHossa shows your real return, your TWR and your lead over the S&P 500.

Create account

Read next