Tax-Loss Harvesting: The Strategy That Can Save You Money Every Year (And the Wash-Sale Rule That Trips People Up)

Tax-loss harvesting is one of the few legitimate strategies that lets you turn a losing investment into a tax advantage. The core idea is simple: sell investments that have declined in value to generate a capital loss, then use that loss to offset capital gains elsewhere in your portfolio. Done consistently, it can meaningfully reduce your tax bill year after year without requiring you to abandon your investment strategy.

This article walks through exactly how the math works, what the limits are, how the wash-sale rule can disqualify your losses if you’re not careful, and when this strategy is actually worth pursuing versus when it’s more trouble than it’s worth.

How the Basic Math Works

Start with the fundamental mechanics. When you sell an investment for more than you paid for it, you owe capital gains tax on the profit. When you sell for less, you have a capital loss. The IRS lets you use those losses to cancel out gains dollar-for-dollar.

Here’s a concrete example. Suppose you sold shares of a tech company earlier in the year and realized a $10,000 capital gain. Later, you notice that a bond fund in your portfolio is sitting at an $8,000 loss. If you sell that fund before December 31, you now have $8,000 in capital losses to apply against your $10,000 gain. Your net taxable gain drops to $2,000.

Instead of paying capital gains tax on the full $10,000, you only pay it on $2,000. If you’re in the 15% long-term capital gains bracket, that’s a difference of $1,200 in taxes owed ($1,500 vs. $300). That’s real money, not a rounding error.

Short-term and long-term losses offset gains in the same category first. If you have more short-term losses than short-term gains, the excess can then offset long-term gains, and vice versa. The IRS has specific ordering rules, but the practical takeaway is that your losses get put to work regardless of type.

The $3,000 Deduction and the Carryforward Rule

What happens when your losses exceed your gains? Say you had no realized gains this year but you sold a losing position for a $5,000 loss. You can’t just write off $5,000 against your salary.

The IRS caps the deduction against ordinary income at $3,000 per year ($1,500 if you’re married filing separately). So in this example, you’d deduct $3,000 from your ordinary income this year and carry the remaining $2,000 forward to next year’s return.

Carryforward losses don’t expire. They follow you into future tax years until they’re fully used up. If you harvested a $15,000 loss in a bad market year, you could potentially carry that forward for five or more years, deducting $3,000 per year against ordinary income or using it to offset any future gains.

This carryforward feature makes tax-loss harvesting especially powerful during market downturns. When your portfolio drops sharply, the losses you harvest can provide tax relief not just this year, but well into the future.

One common misconception: many investors think that if they don’t have capital gains this year, tax-loss harvesting is pointless. That’s not true. The $3,000 deduction against ordinary income still applies, and any excess carries forward. Harvesting losses even in a gain-free year has real value.

The Wash-Sale Rule: Where People Go Wrong

Here’s where tax-loss harvesting gets complicated. The IRS created the wash-sale rule specifically to prevent investors from selling a security purely to capture a tax loss and then immediately buying it back. If you trigger a wash sale, the IRS disallows your loss entirely. You don’t get to claim it at all for that year (though the disallowed loss does get added to the cost basis of the repurchased shares, so it’s not permanently lost).

The rule works like this: if you sell a security at a loss and buy the same or “substantially identical” security within 30 days before or after the sale, the loss is disallowed. That’s a 61-day window total: 30 days before, the day of the sale, and 30 days after.

“Substantially identical” is the term that causes confusion. It clearly covers:

  • Buying back the exact same stock or fund you sold
  • Exercising an option to purchase the same stock within the window
  • Buying the same fund in a different account (including your IRA or spouse’s account)

It does not clearly cover:

  • Buying a similar but different ETF from a different fund family
  • Buying a fund that tracks a different index covering the same broad market

For example, if you sell the Vanguard S&P 500 ETF (VOO) to harvest a loss, you cannot immediately buy the iShares Core S&P 500 ETF (IVV). Both track the exact same index, and while the IRS hasn’t issued a definitive ruling on every ETF pair, the risk that they’d be considered substantially identical is real. However, you could buy the Vanguard Total Stock Market ETF (VTI), which tracks a broader index including mid- and small-cap stocks. You stay invested in U.S. equities, you avoid a wash sale, and you maintain your portfolio’s general exposure.

The same logic applies to international funds, bond funds, and sector ETFs. The goal is to find a replacement that keeps your economic exposure similar but is clearly a different security tracking a different index or holding different underlying assets.

Staying Invested While Harvesting: Practical Approaches

The biggest fear investors have with tax-loss harvesting is being out of the market during the 30-day waiting period and missing a rebound. This fear is legitimate. Markets can move fast, and sitting in cash is its own risk.

The solution is to immediately reinvest proceeds into a similar but not identical position. You don’t have to be out of the market at all.

Here’s how a practical workflow might look:

  1. Identify positions in your taxable account with unrealized losses.
  2. Sell the losing position and simultaneously purchase a similar replacement ETF in a different index or fund family.
  3. Wait at least 31 days.
  4. Decide whether to switch back to your original holding or stay with the replacement.

For example, an investor holding the iShares MSCI EAFE ETF (EFA), which tracks developed international markets, might harvest a loss and replace it with the Vanguard FTSE Developed Markets ETF (VEA). Both give you developed international exposure, but they track different indexes. After 31 days, you can swap back to EFA if you prefer, or simply stick with VEA.

One practical note: if you hold the same fund across multiple accounts, be careful. Buying shares of the same fund in your IRA within the wash-sale window counts. Many investors accidentally trigger wash sales this way, particularly if they have automatic dividend reinvestment turned on in a related account.

When Tax-Loss Harvesting Is Actually Worth It

Tax-loss harvesting is not a universally smart move. There are situations where the effort, transaction costs, or tax consequences make it more trouble than it’s worth.

It makes the most sense when:

  • You’re in a higher tax bracket. If you’re in the 0% capital gains bracket (which applies to single filers with taxable income up to approximately $47,025 in 2024), you don’t owe capital gains tax to begin with, so there’s nothing to offset.
  • You have realized gains to offset. The strategy is most powerful when you have actual gains to cancel out, rather than relying solely on the $3,000 ordinary income deduction.
  • The loss is substantial relative to transaction costs. Selling a position to capture a $200 loss might not be worth the friction, especially if commissions or bid-ask spreads eat into your savings.
  • You’re in a taxable account. Tax-loss harvesting does not apply to IRAs, 401(k)s, or other tax-advantaged accounts. Gains and losses in those accounts don’t create current-year taxable events.

It makes less sense when:

  • You’re close to year-end and can’t complete the 31-day waiting period without risk. If markets rally during the window, your tax savings could be smaller than the opportunity cost.
  • The position you want to sell has been held for less than a year. Short-term losses offset short-term gains first, which are taxed at ordinary income rates. This can work in your favor, but it’s worth thinking through the tax implications carefully.
  • You’re planning to donate appreciated securities to charity. Donating appreciated stock lets you avoid capital gains entirely, which can be more tax-efficient than harvesting losses.

A frequently overlooked cost of tax-loss harvesting is that it defers taxes rather than eliminating them. When you sell a losing position and buy a replacement, your cost basis in the new position is lower. When you eventually sell that replacement, you’ll owe more in gains. The strategy wins because you’re pushing taxes into the future, which has real value due to the time value of money, but it’s not a free lunch.

Robo-Advisors and Automated Tax-Loss Harvesting: Are They Worth It?

Several robo-advisors, including Betterment, Wealthfront, and Schwab Intelligent Portfolios Premium, offer automated tax-loss harvesting as a feature. The appeal is obvious: the software scans your portfolio daily (or continuously) for harvesting opportunities and executes trades automatically, without you having to monitor anything.

For most individual investors doing this manually, you’d realistically check for opportunities once or twice a year, maybe more if the market sells off sharply. Automated systems catch smaller, shorter-term dips you’d never notice on your own.

Betterment has published data suggesting that their automated tax-loss harvesting added an average of 0.77% annually to after-tax returns for taxable accounts in the years studied, though the benefit varies significantly depending on market conditions and the investor’s tax situation. In years with high volatility, the benefit can be much larger.

The tradeoff is cost and control. Betterment charges 0.25% annually on assets under management, and Wealthfront charges a similar fee. If your portfolio is generating meaningful tax-loss harvesting savings, the fee can be worth it. If you’re investing a small taxable balance or you’re in a low tax bracket, you might find that a low-cost index fund at Fidelity or Vanguard plus annual manual reviews is more cost-effective.

Automated tax-loss harvesting is generally most valuable for investors who have large taxable accounts, face high marginal tax rates, and invest in volatile asset classes where losses are more likely to surface throughout the year.

Three Things to Get Right Before You Start

If you’re planning to harvest losses this year, here’s what to prioritize:

Check your whole tax picture first. Capital losses offset capital gains before they do anything else. Know what gains you’ve already realized this year so you can target offsetting those specifically.

Map your accounts carefully. The wash-sale rule applies across all accounts you and your spouse own, including IRAs. If you sell shares in your taxable brokerage and your spouse’s Roth IRA automatically reinvests dividends into the same fund, you could trigger a wash sale without realizing it. Turn off automatic reinvestment in related accounts during the harvesting window.

Think about your replacement security before you sell. Don’t sell a position and then spend two days figuring out what to buy. Markets move. Have your replacement security identified and ready to purchase simultaneously.

Tax-loss harvesting is most effective as a consistent practice rather than a one-time event. Investors who review their portfolios regularly for harvesting opportunities, particularly after market pullbacks, tend to accumulate meaningfully lower lifetime tax bills than those who ignore the strategy entirely.

The math is on your side. You’re using the tax code as it was designed to be used. The key is understanding the rules precisely enough to avoid mistakes, particularly the wash-sale trap, so every loss you harvest actually counts.