Published: April 22, 2026
14 min Read
Editorial Verified

In the world of investing, we are taught to avoid losses at all costs. However, experienced investors and data scientists know that a loss on paper can actually be a gain in your pocket—if you know how to "harvest" it. This is the essence of Tax-Loss Harvesting (TLH).

Tax-loss harvesting is the practice of selling an investment that is trading at a loss to offset capital gains tax liabilities. This strategy allows you to "realize" a loss for tax purposes while immediately reinvesting the proceeds in a similar asset to maintain your market exposure. It is one of the most powerful tools for increasing your after-tax returns, or what we call "Tax Alpha."

💰 Expert Insight

Tax-loss harvesting doesn't just offset investment gains. You can also use up to $3,000 of realized losses to offset your ordinary income each year, which can lead to significant savings regardless of market performance.

The Mechanics: Turning Red into Green

The logic of TLH is straightforward but requires precise execution. Imagine you bought $10,000 of "ETF A" and its value has dropped to $8,000. You have an unrealized loss of $2,000.

If you do nothing, you have $8,000 in assets and a bad mood. If you harvest the loss, you sell "ETF A," realizing the $2,000 loss, and immediately buy $8,000 of "ETF B" (a similar but not "substantially identical" fund).

Now, you still have $8,000 in the market, but you also have a $2,000 tax credit that you can use to cancel out $2,000 of gains elsewhere in your portfolio. If you are in a 20% capital gains tax bracket, you just "found" $400 in tax savings.

The Critical 'Wash-Sale' Rule

The IRS is aware of TLH and has created a specific rule to prevent abuse: The Wash-Sale Rule. This rule states that you cannot claim a loss if you buy a "substantially identical" security within 30 days before or after the sale.

What counts as "Substantially Identical"?

  • Selling S&P 500 ETF (from Vanguard) and buying the exact same S&P 500 ETF (from iShares) is generally considered a wash sale.
  • Selling an S&P 500 fund and buying a "Total Stock Market" fund is generally considered safe, as they track different indices.
  • Selling an individual tech stock and buying a Tech Sector ETF is also a common way to avoid the rule while maintaining exposure.

🚨 The 61-Day Window

The wash-sale rule applies to a 61-day window: the 30 days before the sale, the day of the sale, and the 30 days after. If you buy the security in any of your accounts (including an IRA or your spouse's account) during this window, the loss is disallowed.

Strategy for Volatile Markets

In 2026, market volatility has become the "new normal." While volatility can be stressful, it is the primary fuel for tax-loss harvesting. The more the market swings, the more opportunities you have to harvest losses.

Don't wait until December to look for losses. A "harvesting event" can happen at any time. If the market drops 10% in May, harvest then. By waiting until the end of the year, you might miss the dip if the market recovers.

Calculating Your 'Tax Alpha'

As a data scientist, I like to quantify the value of every strategy. The value of TLH isn't just the immediate tax saving; it is the compounding of those savings over time.

If you save $1,000 in taxes this year and reinvest that $1,000, it will grow alongside your original portfolio. Over 20 years at a 7% return, that single $1,000 harvest turns into nearly $4,000. This is "Tax Alpha"—the extra return generated through intelligent tax management rather than just market performance.

The Long-Term Impact

Tax-loss harvesting is a "tax deferral" strategy. You are essentially lowering your cost basis today to save on taxes now, which means you might pay more in taxes in the future when you eventually sell.

However, because of the time value of money, a dollar saved today is worth far more than a dollar paid twenty years from now. Furthermore, if you donate the appreciated shares to charity later or pass them on to heirs (who get a "step-up" in basis), the tax savings become permanent.

TLH is a sophisticated strategy that requires diligence and data tracking. Use our Net Worth Calculator to keep a bird's-eye view of your assets, and consult with a tax professional to ensure your harvesting plan complies with the latest 2026 IRS regulations.

✔️ Summary Checklist

  • Identify "losing" positions in taxable accounts.
  • Ensure the replacement security is not "substantially identical."
  • Monitor the 30-day window before and after for wash sales.
  • Reinvest tax savings to maximize the compounding effect.
Terry Stagg

About the Author

Terry StaggFounder & Data Scientist

Terry is a data scientist and systems engineer who specializes in algorithmic finance and tax optimization. He founded Budget With You to simplify complex financial strategies through data.

Was this article helpful?

More from the Journal