What is tax-loss harvesting?
Tax-loss harvesting (TLH) is the practice of selling an investment that has declined below your purchase price in order to realize the loss as a tax deduction. The loss offsets capital gains elsewhere in your portfolio, or — up to $3,000 per year — ordinary income. After selling, you immediately reinvest the proceeds in a similar (but not identical) asset to preserve your market exposure. The net effect is a tax saving today in exchange for a slightly different investment going forward.
The wash sale rule
The IRS wash sale rule prevents you from claiming a loss if you buy a "substantially identical" security within 30 days before or after the sale. If you sell a fund and buy the same fund back the next day, the loss is disallowed and instead added to the cost basis of the replacement shares. The rule applies across taxable accounts, IRAs, and even spousal accounts — so you cannot route around it by selling in one account and buying back in another.
Why a "similar but not identical" substitute?
The wash sale constraint pushes investors toward close substitutes rather than exact replacements. In practice this means swapping one S&P 500 ETF for a total-market ETF, or exchanging a sector fund for a broad-market fund covering the same exposure. The two funds will not behave identically — that difference is called tracking error, and it is the drag this calculator quantifies. Smaller tracking error is better, but zero tracking error would mean buying the same security back, triggering the wash sale.
When TLH does not help
If you are in the 0% long-term capital gains bracket (taxable income below roughly $47,000 for single filers in 2025), long-term losses provide no current benefit — you would not owe tax on the gain anyway. TLH is most valuable for investors in the 15%, 20%, or 23.8% LTCG brackets, and especially powerful when a short-term loss can offset ordinary income taxed at 22%–37%.
The deferred gain at swap-back
When you eventually sell the substitute position, the gain is measured from the new, lower cost basis (the price at which you bought the substitute). The deferred tax does not disappear — it reappears at that later sale. If the gain is then long-term, the deferred rate may be lower. If you hold until death, the step-up in basis eliminates the deferred gain entirely for heirs. This deferral value is not captured in the simple net-benefit calculation above.
Mutual funds vs ETFs for TLH
ETFs are generally more practical for tax-loss harvesting than mutual funds. ETF shares trade intraday, so you can sell one ETF and buy a substitute in the same minute without a gap in market exposure. Mutual fund transactions settle once daily at net asset value, creating at least one day of unhedged exposure during the swap. Additionally, ETFs that track different indexes from the same asset class are readily available — Vanguard, iShares, and Schwab each offer similar-but-not-identical index products — making it straightforward to find wash-sale-compliant substitutes.