Tax-Loss Harvesting - A Practical Guide

Tax-loss harvesting is the practice of selling investments at a loss to offset capital gains and reduce taxable income. It is one of the few strategies in investing that creates value without requiring any prediction about markets, any change in portfolio exposure, or any additional risk. Executed correctly, it can add 0.5% to 1.5% in after-tax returns per year, compounding into substantial wealth over decades.

The concept is straightforward: sell a losing position, use the realized loss to offset taxable gains elsewhere in the portfolio, and immediately reinvest the proceeds in a similar (but not identical) investment to maintain market exposure. The portfolio's risk profile remains essentially unchanged while the tax bill decreases.

Wealthfront, one of the largest automated investment advisors, reported that their tax-loss harvesting algorithm generated an average of 1.8% in annual tax savings for clients over the 2012-2022 period. On a $500,000 portfolio, that represents $9,000 per year in tax savings, money that compounds inside the portfolio rather than being sent to the IRS.

How It Works

Step 1: Identify a position with an unrealized loss. An investor bought $10,000 of the Vanguard Total Stock Market ETF (VTI) three months ago, and it has declined to $8,500, creating a $1,500 unrealized loss.

Step 2: Sell the position, realizing the $1,500 loss. The loss is now available to offset capital gains.

Step 3: Immediately purchase a similar but not "substantially identical" investment. The investor buys $8,500 of the Schwab U.S. Broad Market ETF (SCHB), which tracks a nearly identical set of stocks as VTI but is a different fund.

Step 4: The $1,500 realized loss offsets $1,500 of capital gains realized elsewhere in the portfolio. If no gains exist, up to $3,000 of losses can be deducted against ordinary income ($1,500 for married filing separately), and any excess carries forward to future years indefinitely.

The portfolio's exposure to U.S. stocks is unchanged. The investor went from holding VTI to holding SCHB, both of which track the broad U.S. equity market with nearly identical performance. But the investor now has a $1,500 tax asset that reduces future tax liability.

The Tax Math

Capital losses offset capital gains dollar-for-dollar. Short-term losses (on positions held less than one year) first offset short-term gains (taxed at ordinary income rates of 10% to 37%), then offset long-term gains (taxed at 0%, 15%, or 20%). Long-term losses first offset long-term gains, then offset short-term gains.

Because short-term gains are taxed at higher rates, short-term losses are more valuable per dollar. A $1,000 short-term loss that offsets a $1,000 short-term gain saves $240 to $370 in taxes (at the 24% to 37% brackets). A $1,000 long-term loss offsetting a long-term gain saves $150 to $200.

When losses exceed gains, the excess is deductible against ordinary income up to $3,000 per year ($1,500 for married filing separately). For an investor in the 32% bracket, this $3,000 deduction saves $960 in federal taxes. Any remaining losses carry forward indefinitely. An investor who realizes $50,000 in losses in a particularly bad year can spread the benefit across many future years of gains.

The carryforward provision means that losses are never wasted. Even if the investor has no gains to offset in the current year, the losses accumulate and can be deployed against future gains or income. Some aggressive tax-loss harvesters intentionally realize losses well in excess of current needs, building a large carryforward balance that provides years of future tax savings.

The Wash Sale Rule

The IRS's wash sale rule prevents investors from claiming a tax loss if they purchase a "substantially identical" security within 30 days before or after the sale. The 30-day window runs in both directions: 30 days before the sale and 30 days after, creating a 61-day total window.

If the rule is triggered, the disallowed loss is added to the cost basis of the repurchased shares, deferring (but not eliminating) the tax benefit. The loss is not lost permanently; it is embedded in the replacement position's cost basis and will be recognized when that position is eventually sold.

What counts as "substantially identical" is not precisely defined by the IRS, which creates some ambiguity. Clear violations include: selling VTI and buying VTI within 30 days; selling VTI shares in a taxable account and buying VTI in an IRA within 30 days (the wash sale rule applies across all accounts owned by the same taxpayer and their spouse). The rule also applies to options on the same security.

Safe replacements include: selling VTI (Vanguard Total Stock Market) and buying ITOT (iShares Core S&P Total U.S. Stock Market), selling the SPDR S&P 500 ETF (SPY) and buying the iShares Core S&P 500 ETF (IVV), or selling an individual stock and buying an ETF that holds that stock as one of many positions. The replacement should provide similar market exposure without being so similar that the IRS would consider it "substantially identical."

Mutual funds that track the same index (e.g., selling Fidelity 500 Index Fund and buying Vanguard 500 Index Fund) are more ambiguous. Conservative practitioners wait the full 31 days before repurchasing the original fund, while more aggressive ones argue that funds from different providers are not substantially identical. Tax advisors are split on this question, and there is no definitive IRS ruling.

Optimal Harvesting Strategies

Continuous harvesting. Some robo-advisors and sophisticated investors monitor portfolios daily for harvesting opportunities. Any position with a loss above a minimum threshold (e.g., $100) is harvested and replaced. This approach maximizes the total losses realized over time but requires automation to be practical.

Triggered harvesting. Harvesting occurs only during significant market declines. When the market drops 10% or more, the investor reviews all positions and harvests every available loss. This approach captures the largest losses per transaction and is practical for investors who manage their own portfolios.

Year-end harvesting. The most common approach for individual investors. In November or December, the investor reviews the portfolio for unrealized losses, harvests them, and reinvests in similar positions. The losses offset any gains realized during the year, reducing the tax bill. This approach is simple but misses harvesting opportunities during mid-year market declines.

The optimal approach depends on portfolio size, the frequency of market volatility, and whether the investor is using automated tools. For most investors managing their own portfolios, a combination of triggered and year-end harvesting captures the majority of the available tax benefit.

Tax-Loss Harvesting With Individual Stocks

Individual stocks offer more harvesting opportunities than index funds because their prices are more volatile and they can be replaced with other individual stocks in the same sector without triggering wash sale concerns.

An investor who holds Apple (AAPL) at a loss can sell and replace it with Microsoft (MSFT), maintaining technology sector exposure while realizing the loss. The two stocks are different companies and are clearly not "substantially identical," so the wash sale rule does not apply. If the investor prefers to own Apple specifically, they can repurchase AAPL after 31 days.

The risk of this approach is that the replacement stock may perform differently from the original. If Apple rallies 10% during the 31-day exclusion period while the investor holds Microsoft, the harvesting exercise has cost more in missed appreciation than it saved in taxes. This tracking risk is the main cost of tax-loss harvesting with individual stocks.

For index funds, the tracking risk is minimal because replacement funds track nearly identical indices. VTI and SCHB have a return correlation above 0.99. The risk of significant performance divergence during the 31-day window is negligible.

When NOT to Harvest

Short-term positions approaching long-term status. If a stock has been held for 10 months and shows a loss, selling now realizes a short-term loss. If the stock recovers within the next two months, the investor would rebuy at a higher price and reset the holding period. It may be better to wait until the position qualifies for long-term treatment, which provides a lower tax rate on future gains.

Positions with large unrealized gains in the replacement. If the replacement security already has a large unrealized gain, harvesting creates a deferred tax liability on the replacement that may exceed the immediate tax benefit. The total tax picture, not just the current year's tax bill, determines whether harvesting is beneficial.

In tax-advantaged accounts. IRAs, 401(k)s, and Roth IRAs do not generate taxable gains or deductible losses. Tax-loss harvesting is exclusively a taxable account strategy. However, purchases in tax-advantaged accounts of a substantially identical security within the wash sale window can disallow the loss in the taxable account, so coordination across all accounts is necessary.

When transaction costs exceed the tax benefit. For very small positions, the time and potential market impact of selling and repurchasing may exceed the tax savings. A $200 loss at a 24% tax bracket saves $48 in taxes. If the harvesting process takes 30 minutes and creates bid-ask spread costs, the net benefit may be negligible.

The Long-Term Compounding Effect

The true value of tax-loss harvesting is not the tax savings in any single year but the compounding of those savings over decades. Each dollar saved from taxes remains invested in the portfolio, generating returns that are themselves subject to future tax-loss harvesting. This creates a virtuous cycle of tax savings generating returns generating further tax savings.

A concrete example: an investor with a $500,000 portfolio who harvests an average of $10,000 in losses per year at a 24% tax rate saves $2,400 annually. That $2,400, reinvested at 8% for 25 years, grows to approximately $197,000. The cumulative tax savings over 25 years total $60,000, but the compounded value of keeping that money invested is over three times larger.

This compounding effect is why tax-loss harvesting is most valuable for young investors with long time horizons. The earlier the tax savings begin compounding, the larger the terminal benefit. An investor who begins systematic tax-loss harvesting at age 30 captures 35 to 40 years of compounding on the saved taxes, generating a benefit that dwarfs the annual savings in isolation.

Tax-loss harvesting does not change what the investor owns. It does not require predicting markets. It does not increase risk. It simply ensures that the inevitable losses that occur in any portfolio, as individual positions temporarily decline, generate a tangible financial benefit rather than being purely psychological pain. It converts the unpleasant experience of unrealized losses into concrete tax savings, making it one of the few strategies in investing that is both emotionally and financially rewarding.

Nazli Hangeldiyeva
Written by
Nazli Hangeldiyeva

Co-Founder of Grid Oasis. Political Science & International Relations, Istanbul Medipol University.

View full profile →

Put these principles into practice. Track fundamentals, build portfolios, and analyze stocks with AI-powered insights.

Start Free on GridOasis →