Calm Capital

What Is Tax-Loss Harvesting?

By the Calm Capital Editorial Team · Updated November 16, 2026

Man pruning an apple tree in a calm autumn orchard

Tax-loss harvesting means selling an investment that has dropped below what you paid, so you can use that loss to offset capital gains and, within IRS limits, some other income. It's a legal, widely discussed practice, but it comes with rules and trade-offs, and the most important rule is the wash sale rule. If you sell at a loss and buy a substantially identical investment within 30 days before or after the sale, the IRS generally won't let you deduct that loss at that time.

This guide, part of our Taxes & Investing section, explains the idea in general terms. It isn't a recommendation to harvest losses. Whether it makes sense depends on your whole tax picture, which is something to work through with a tax professional.

The idea in plain language

When you sell an investment for more than you paid, you have a capital gain. When you sell for less, you have a capital loss. In general, the tax rules let you use losses to offset gains. Our guide to capital gains basics explains how gains and losses are measured in the first place.

Tax-loss harvesting is simply being deliberate about this. Instead of letting a loss sit on paper, an investor sells to "realize" it, then uses that realized loss on their tax return.

A hypothetical example

Example (made-up numbers, not typical or expected): Morgan sold one fund earlier in the year for a hypothetical $1,000 gain. They also own a different fund that is now worth $800 less than they paid. If Morgan sells that second fund, they realize an $800 loss, which could generally offset most of the $1,000 gain. Whether that's wise depends on what Morgan does next, their costs, and their tax situation, which a tax professional would look at with them.

The wash sale rule, in depth

The wash sale rule is the part that catches people. Here's how it works in general.

  • The window is 61 days. It covers the 30 days before the sale, the day of the sale and the 30 days after.
  • "Substantially identical" is the key phrase. Buying back the same stock or the same fund within that window is a clear wash sale. Whether two different funds are "substantially identical" can be less clear, and the IRS doesn't give a simple list.
  • The loss isn't lost forever, in general. A disallowed loss is usually added to the cost basis of the replacement shares, which can affect your taxes when you later sell those.
  • It can apply across your accounts. Purchases in other accounts you control, and in some cases a spouse's accounts, may count. Automatic investments and dividend reinvestment can also trigger a wash sale without you noticing.
SituationWash sale risk?
Sell at a loss, wait more than 30 days, then buy backGenerally no, though you're out of the investment during that time
Sell at a loss, buy the same investment two weeks laterYes, generally a wash sale
Buy more shares, then sell older shares at a loss within 30 daysYes, purchases before the sale count too
Sell at a loss while a dividend reinvests in the same fundPossibly; check with a tax professional

The exact rules and how they apply to your accounts are explained on IRS.gov. Because the details are easy to get wrong, this is a good topic to raise with a CPA or enrolled agent.

The trade-offs people don't mention

Tax-loss harvesting is often presented as free money. It isn't, for a few reasons.

  1. It can lower your cost basis. If you buy a replacement investment at a lower price, your future gain on it may be larger, so some of the tax savings may simply be pushed later.
  2. It changes your portfolio. Selling and buying something different, even briefly, can shift your risk in ways you didn't plan.
  3. There can be costs. Trading costs, bid-ask spreads and time all add up.
  4. There are limits. The IRS limits how much net capital loss you can use against other income in a year, with remaining losses carried forward. Check IRS.gov for the current rules.
  5. Mistakes are easy. One forgotten automatic purchase can trigger a wash sale.

Where it generally doesn't apply

Losses inside retirement accounts, HSAs and 529 plans generally can't be harvested, because those accounts aren't taxed year by year on gains and losses. Our overview of tax-advantaged accounts explains why. If most of your investments are in a 401(k) or IRA, tax-loss harvesting may simply not be relevant to you.

The same goes for health savings: if you invest inside an HSA, the account's own tax treatment, covered in our HSA basics guide, is what matters, not loss harvesting.

Don't let a falling market rush you

Tax-loss harvesting tends to get attention when markets drop. That's also when emotions run highest. Selling in a panic and calling it "harvesting" isn't a plan. Our guide to what to do when the stock market drops explains why volatility is a normal part of investing and how to avoid decisions you'll regret.

If someone pitches you a course or software promising big tax savings from "automated harvesting", ask how it handles the wash sale rule across all your accounts, what it costs, and who is responsible if it gets it wrong. Our guide to judging stock newsletters and alerts covers similar questions for paid services.

Where losses show up on your forms

Realized gains and losses from a taxable account generally appear on a year-end tax form from your brokerage. Some brokerages flag wash sales they can detect within that single account, but they may not see purchases in your other accounts. Our guide to investment income taxes explains the year-end forms you're likely to receive.

Questions to ask a tax professional

  • Do I have gains this year that losses could offset?
  • Do I have losses carried over from earlier years?
  • Could any of my automatic investments trigger a wash sale?
  • How would a replacement investment change my cost basis and risk?
  • Do state tax rules change the picture for me?

Something to do today

If you have a taxable account, check whether you have automatic investments or dividend reinvestment turned on, and in which funds. Write them down. Even if you never harvest a loss, knowing this helps you and your tax professional spot possible wash sales before they happen.

This guide is general education, not tax or investment advice. Tax rules change and depend on your circumstances; check IRS.gov and consider working with a qualified tax professional.

Partner offer · paid placement

Want a structured investing course?

Some people like the structure of a paid program. This button opens a third-party investing course, newsletter or program from one of our advertising partners. Its claims are its own, not ours, and we haven't verified any results it describes. Investing involves risk, including loss of money. Never invest money you can't afford to lose, and weigh any offer against our investment red flags checklist.

See the partner program →

We may be paid when you click. The program shown can change. Read its terms before you buy anything. How this works

Frequently asked questions

What is the wash sale rule?

If you sell an investment at a loss and buy a substantially identical one within 30 days before or after the sale, the IRS generally won't let you deduct that loss at that time. The rule exists to stop people from claiming a loss while keeping essentially the same investment.

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

Generally, no. Gains and losses inside retirement accounts aren't taxed year by year, so selling at a loss there usually doesn't create a deductible loss. Tax-loss harvesting is usually discussed for regular taxable accounts.

Is tax-loss harvesting always a good idea?

Not always. It can involve trading costs, it can change your portfolio, and it may lower your cost basis, which can mean more tax later. Whether it makes sense depends on your situation, so a tax professional is the right person to ask.

See a partner programPartner offer
Partner offer · paid placement

Want a structured investing course?

If you'd like more structure than articles can give, you can look at a third-party investing course or newsletter from one of our partners. Its claims are its own, and investing always involves risk. No pressure: our free guides aren't going anywhere.

See the partner program →

We may be paid when you click. How this works