Skip to content
TaxWren
Next IRS deadline:Extended 2025 tax returns due ·

Investing · Guide

Tax-loss harvesting: how it works and what it saves

Sell investments at a loss to cancel out gains, deduct up to $3,000 a year from other income and carry the rest forward, without breaking the 30-day wash-sale rule.

By the TaxWren team · Updated · 3 min read

Key takeaways

  • Capital losses first cancel out capital gains, so selling losers can cut the tax on your winners.
  • If losses are bigger than gains, up to $3,000 a year ($1,500 if married filing separately) reduces your other income, and the rest carries forward to later years.
  • A loss is disallowed if you buy substantially identical stock or securities within 30 days before or after the sale, including in your IRA or through your spouse.
  • It postpones tax rather than erasing it: the replacement investment starts from a lower cost basis.
On this page
  1. How does tax-loss harvesting work?
  2. What if my losses are bigger than my gains?
  3. What is the wash-sale rule?
  4. Is tax-loss harvesting worth it?

Tax-loss harvesting means selling investments that are worth less than you paid, so the loss reduces the tax on your gains or on your other income. It works only in taxable brokerage accounts, the losses have to be real sales, and the wash-sale rule stops you from selling and buying straight back.

How does tax-loss harvesting work?

Capital gains and losses for the year are netted. Losses first cancel out gains, short-term losses against short-term gains and long-term losses against long-term gains, then across the two. Whatever net gain is left is taxed; a net loss can reduce your other income, up to a limit.

The saving is larger against short-term gains, which are taxed at ordinary rates. Try different amounts in the capital gains tax calculator by entering the net gain.

What if my losses are bigger than my gains?

Up to $3,000 of net capital loss a year ($1,500 if married filing separately) is deducted from your other income, such as wages. Any loss above that carries forward to the next year, where it again offsets gains first and then up to $3,000 of other income.

Example: $5,000 of gains and $15,000 of losses leave a $10,000 net loss. The gains are not taxed (worth about $750 here), $3,000 reduces wages, saving about $660 of federal income tax for a single filer with $90,000 of wages, and $7,000 carries forward.

What is the wash-sale rule?

You cannot deduct a loss on stock or securities if, within 30 days before or after the sale, you:

  • buy substantially identical stock or securities,
  • acquire them in a fully taxable trade,
  • acquire a contract or option to buy them, or
  • buy them in your IRA or Roth IRA.

It is also a wash sale if your spouse or a corporation you control buys substantially identical stock. The disallowed loss is added to the cost of the new shares, so you get it later when you sell them, except when the purchase was in an IRA.

Is tax-loss harvesting worth it?

It defers tax more than it removes it. If you buy a similar investment, its lower cost basis means a larger gain when you eventually sell. The benefit is real when the loss offsets gains taxed at high rates now, when it reduces ordinary income by up to $3,000 a year, or when you may never sell the replacement. Harvested losses count in the tax year of the sale, so year-end is when people review them, alongside their estimated tax for the last quarter.

Sources

  1. IRS: Topic no. 409, Capital gains and losses (official)
  2. IRS: Publication 550, Investment Income and Expenses (wash sales) (official)

Figures come from the data files behind our calculators and update with them. See our methodology and editorial policy. This article is general information, not tax advice.

Report an error

Tell us what looks wrong. We attach this page and your calculator inputs so we can reproduce it.

Frequently asked questions

How much capital loss can I deduct in a year?

Losses offset all of your capital gains first. Beyond that, up to $3,000 a year ($1,500 if married filing separately) can be deducted from other income. The rest carries forward to later years.

What is the wash-sale rule?

If you sell stock or securities at a loss and buy substantially identical ones within 30 days before or after the sale, you cannot deduct the loss. It also applies if your spouse or a corporation you control buys them, or if you buy them in an IRA. The disallowed loss is usually added to the cost of the new shares.

Does tax-loss harvesting work in an IRA or 401(k)?

No. Gains and losses inside tax-advantaged retirement accounts are not reported each year, so there is nothing to harvest. Harvesting only works in taxable brokerage accounts.

Can I buy the same stock back after 30 days?

Yes. Once more than 30 days have passed after the sale (and you did not buy it in the 30 days before), the loss stands. Some investors buy a similar but not substantially identical investment in the meantime to stay invested.

Run your own numbers

  • Capital gains tax calculator

    Tax on selling stocks, crypto, property or a home, and on dividends: 0/15/20% long-term and qualified dividend rates, short-term rates, 3.8% NIIT, state tax and the main home exclusion.

  • Income tax calculator

    Federal and state income tax owed for 2026.

  • Estimated tax calculator

    Quarterly federal estimated tax (Form 1040-ES): this year's tax, the safe amount from 90% of this year or 100%/110% of last year, withholding and every due date.

More on investing