Tax Planning

Tax-Loss Harvesting: How It Works, the Wash Sale Rule, and What It Really Saves

Tax-loss harvesting means selling an investment that has fallen in value so the loss can cancel out taxable gains elsewhere. Losses offset gains first, and up to $3,000 a year of net loss ($1,500 if married filing separately) can also offset wages and other income, with the rest carried forward "until it is completely used up," in IRS Publication 550's words. The catch is the wash sale rule: buy the same or a substantially identical investment within 30 days before or after the sale, in any of your accounts or your spouse's, and the loss is disallowed. This guide covers the mechanics, the rule, and an honest look at how much harvesting is worth.


The Short Answer

  • What it does: a realised loss offsets realised capital gains, then up to $3,000 of ordinary income a year. Unused losses carry forward with no time limit.
  • The wash sale rule: no loss if you buy substantially identical stock or securities within 30 days before or after the sale, including inside your IRA or Roth IRA, or if your spouse buys it.
  • The deadline is the trade date, so a sale on 31 December counts for that year even though it settles in January.
  • Only taxable accounts. Losses inside a 401(k) or IRA cannot be harvested.
  • Mostly a deferral. Selling lowers your cost basis in whatever you buy instead, so the tax comes back when you eventually sell, unless you sell in a lower bracket or hold it until death.

How It Works

At tax time, your gains and losses for the year are netted in a fixed order on Schedule D: short-term losses against short-term gains, long-term losses against long-term gains, then the two net figures against each other. What is left decides your tax:

  • A net gain is taxed at your ordinary rate if it is short-term, or at 0%, 15% or 20% if long-term. The 2026 thresholds are on our capital gains tax page.
  • A net loss reduces other income by "the lesser of $3,000 ($1,500 if married filing separately) or your total net loss," per IRS Topic no. 409.
  • Anything left over carries forward to next year, and Pub 550 says "it remains long-term or short-term."

Harvesting is simply choosing to realise losses deliberately, usually selling a holding that is down and immediately buying something similar but not identical, so your market exposure barely changes while the loss lands on this year's return.


The Wash Sale Rule

IRS Publication 550 defines it: "A wash sale occurs when you sell or trade stock or securities at a loss and within 30 days before or after the sale you:"

  1. "Buy substantially identical stock or securities,"
  2. "Acquire substantially identical stock or securities in a fully taxable trade,"
  3. "Acquire a contract or option to buy substantially identical stock or securities, or"
  4. "Acquire substantially identical stock for your individual retirement arrangement (IRA) or Roth IRA."

It also applies if "your spouse or a corporation you control buys substantially identical stock." Three consequences follow:

  • The window is 61 days: 30 days before the sale, the sale day, and 30 days after. Buying first and then selling the older lot at a loss is caught too.
  • In most cases the loss is postponed, not lost. The disallowed loss is added to the cost of the new shares, and their holding period includes that of the shares you sold. Pub 550's example: buy 100 shares for $1,000, sell for $750, rebuy within 30 days for $800. The $250 loss is disallowed, and the new basis is $1,050.
  • The IRA case is the exception. The basis adjustment applies "except in (4)," the IRA and Roth IRA case. Rebuy in your IRA and there is no basis step-up to recover the loss later, so treat it as gone.

What counts as "substantially identical"? The IRS has not published a bright-line test. Pub 550 says "you must consider all the facts and circumstances," and that "ordinarily, stocks or securities of one corporation are not considered substantially identical to stocks or securities of another corporation." Selling one company and buying a different company in the same industry is therefore generally outside the rule. For funds there is no IRS ruling; investors commonly switch to a fund tracking a different index, while swapping between two share classes of the same fund, or two funds with the same holdings, sits much closer to the line.

Automatic purchases count. Reinvested dividends, recurring contributions and employer-plan purchases are purchases. A dividend reinvestment into the same fund within 30 days of a loss sale can disallow part of the loss, so switch reinvestment off on the fund you are selling for the duration.


What It Really Saves

This is the part most descriptions skip. The following is a hypothetical illustration.

An investor bought a fund for $50,000. It is now worth $40,000. They sell, realise a $10,000 loss, and buy a similar fund for $40,000. The same year they have a $10,000 long-term gain elsewhere, taxed at 15%.

No harvestHarvest
Tax on the $10,000 gain this year$1,500$0
Cost basis of the fund they now hold$50,000$40,000
Gain if the fund is later sold for $60,000$10,000$20,000
Extra tax on that later sale at 15%n/a+$1,500
Illustrative arithmetic. The $1,500 saved now is repaid on the later sale, because the new fund's basis is $10,000 lower.

So for someone who keeps the same tax rate and eventually sells, harvesting is mostly an interest-free loan from the government: real value, but smaller than the headline. It becomes a permanent saving in three cases:

  • The loss offsets short-term gains or ordinary income taxed at 22%, 24% or more, while the later gain is long-term at 15% or 0%. The $3,000 annual offset against wages is the cleanest example: at a 24% bracket that is $720 of tax saved now against at most $450 at 15% later.
  • You sell later in a lower bracket, for example in the 0% long-term band in early retirement.
  • You never sell. The basis of inherited assets is reset to the market value at death, per IRS Publication 551, so the deferred gain is never taxed.

Doing It Well

  1. Pick the lots, not just the fund. If you bought at different times, tell your broker which shares to sell. Pub 550 requires you to specify the shares "at the time of the sale" and receive written confirmation; if you cannot identify them, the IRS treats the oldest shares as sold first, which are often the ones with gains.
  2. Prefer short-term losses. They first offset short-term gains, which would otherwise be taxed at ordinary rates.
  3. Have the replacement ready. Decide in advance which fund you will buy instead, so you are not out of the market for 31 days. A pair of funds tracking different but overlapping indexes is the usual choice.
  4. Check every account. Pause dividend reinvestment and automatic purchases of the fund you sold, including in your IRA and your spouse's accounts, for the 30 days after the sale.
  5. Trade by 31 December. Pub 550 confirms the trade date governs: a sale on 31 December is reported that year "even though you received the payment" in January.
  6. Keep records. Your broker reports cost basis on Form 1099-B, but it only sees the accounts it holds. A wash sale triggered by a purchase at another broker, in your IRA or by your spouse may not show on the form, and reporting it correctly is still your responsibility.

When Not to Bother

  • All your investments are in tax-advantaged accounts. There is nothing to harvest.
  • You are in the 0% long-term bracket. Harvesting a loss to offset a gain taxed at 0% saves nothing now and lowers your basis. The opposite move, harvesting gains in the 0% band, is usually the better one. See the 2026 capital gains thresholds.
  • The loss is small and the trading costs or bid-ask spreads are not.
  • The replacement would change your portfolio in a way you would not otherwise choose. The tax tail should not wag the investment dog.

Sources & Methodology

  • IRS Publication 550, for the wash sale rule and its example, "substantially identical," loss carryovers, share identification, and the trade-date rule.
  • IRS Topic no. 409, for the $3,000 and $1,500 annual loss limits.
  • IRS Publication 551, for the basis of inherited property.

The "What It Really Saves" table is our own illustration using a flat 15% rate.


FAQ

What is tax-loss harvesting?
Selling an investment at a loss so the loss offsets capital gains, and up to $3,000 of other income a year, usually while buying a similar but not identical investment to stay invested.

How much can I deduct from tax-loss harvesting?
Losses offset gains without limit. Beyond that, up to $3,000 a year of net loss ($1,500 married filing separately) offsets other income, and the rest carries forward until used up.

What is the wash sale rule?
You cannot claim a loss if you buy substantially identical stock or securities within 30 days before or after the sale, including in your IRA or Roth IRA, or if your spouse does.

Can I buy the same stock back after 30 days?
Yes. On the 31st day after the sale, the wash sale window has closed.

Does the wash sale rule apply to my IRA?
Yes. Buying the same security in your IRA or Roth IRA within the window triggers a wash sale, and in that case the disallowed loss is not added to the IRA shares' basis.

Can I harvest losses inside a 401(k) or IRA?
No. Gains and losses inside those accounts are not reported on your tax return.

What is the deadline for tax-loss harvesting?
The trade date must fall in the tax year, so a sale on 31 December counts for that year even though it settles in January.

This article is for general information and is not tax or investment advice. Rules are from IRS Publications 550 and 551 and IRS Topic no. 409, checked against the primary sources on 2026-09-30. The example is hypothetical. Consider a tax professional before harvesting large losses or where accounts span several brokers.