Tax-Loss Harvesting: How It Works
Investors can sell securities at a loss to offset capital gains from other profitable investments, reducing taxable income and deferring tax liability. The mechanics are straightforward, but the 30-day wash-sale window—which prevents repurchasing an identical security—creates timing and reinvestment discipline that determines whether the strategy has genuine economic value.
The Basic Mechanics
Suppose an investor owns 100 shares of a stock purchased at $50/share ($5,000 invested), now worth $35/share ($3,500 value). The loss is $1,500. The investor also holds another stock bought at $20/share, now worth $30/share—a $1,000 gain.
If the investor sells both securities in the same calendar year, the realized loss ($1,500) and realized gain ($1,000) can be netted: the net capital loss is $500. That $500 reduces taxable income, and therefore reduces the investor’s tax liability.
The benefit depends on the investor’s marginal tax rate. If the investor is in the 24% federal bracket, the $500 loss saves $120 in federal tax. If state taxes apply, the state benefit adds to this. Over many securities and years, harvesting can compound into meaningful tax deferral.
The constraint is timing. To harvest a loss, the investor must actually sell the security. There is no “unrealized loss” deduction; the loss must be realized to generate a tax-loss carryforward or offset.
The Wash-Sale Rule
The IRS imposes the wash-sale rule to prevent pure tax arbitrage: selling a security at a loss to get a deduction while maintaining the same economic position (and upside) by immediately repurchasing it.
The rule is: if an investor sells a security at a loss, and purchases a substantially identical security within 30 days before the sale or 30 days after the sale, the loss is disallowed. The 61-day window (30 days before + day of sale + 30 days after) is the constraint.
“Substantially identical” is defined broadly: a stock and a forward contract on that stock are substantially identical. An American Depositary Receipt (ADR) and the underlying foreign stock are substantially identical. But two different mutual funds tracking the same index are generally not considered substantially identical, and two different stocks in the same sector are clearly not.
This gives investors a path around the constraint: substitute purchases. After selling a losing position, the investor can immediately buy a similar but not identical security. For example:
- Sell a tech-heavy actively managed fund at a loss; buy a tech-focused ETF immediately.
- Sell Apple stock at a loss; buy Microsoft, or a broad tech ETF.
- Sell a corporate bond fund at a loss; buy a different corporate bond fund or a municipal bond fund.
The economic exposure shifts slightly—the investor is no longer short Apple and long Microsoft, but long Microsoft instead—but the loss is realized and deductible, and the investor avoids being cash-heavy or out of the market during the 30-day window.
Calculating the Net Benefit
Tax-loss harvesting is only worthwhile if the benefit exceeds the cost. The costs are subtle:
Opportunity cost: If the original security has a higher expected return than the substitute, switching to the substitute underperforms. Suppose the losing tech stock is expected to outperform the tech ETF bought instead. By switching, the investor foregoes that outperformance.
Tracking error: The substitute may track differently. A sector ETF might underweight the lost stock’s best opportunities or overweight weaker players.
Transaction costs: Selling and buying incurs brokerage fees (often waived for ETFs) and bid-ask spreads. Across many harvesting trades, these add up.
Complexity: Tracking wash sales, cost basis, and tax lots across dozens of trades is administratively burdensome. Errors can lead to disallowed deductions or incorrect tax reporting.
The net benefit, in simple terms, is:
Benefit = (Loss realized) × (Marginal tax rate) Cost = Opportunity cost of substitute + Transaction costs + Administrative burden
For a $5,000 loss in the 24% bracket with no other costs, the benefit is $1,200. If the substitute underperforms by 0.5% annually and is held for 5 years, the opportunity cost approaches $125–$250. The net benefit is still positive. But if the substitute underperforms by 3% annually, the opportunity cost is much higher, and the benefit may be negative.
Large, tax-aware investors (and robo-advisors) harvest continuously, because they have:
- High marginal tax rates (25%+ federal + state), making each dollar of loss worth more.
- Diversified portfolios where substitute purchases are easy to identify with minimal opportunity cost.
- Automated systems that handle wash sales and cost-basis tracking.
Smaller investors or those in low tax brackets (e.g., retirees with little taxable income) often break even or lose money harvesting.
Carryforwards and Long-Term Deferral
A harvest in December can be carried forward to subsequent years if the losses exceed gains. The IRS allows unlimited carryforward of unused capital losses to future years. An investor who harvests $10,000 in losses but has only $3,000 in gains can deduct the $3,000 against gains, reduce ordinary income by up to $3,000 (in the current year), and carry the remaining $4,000 forward indefinitely.
This deferral aspect is powerful: by harvesting early (while the loss exists), an investor locks in the deduction and can use it whenever gains are realized. An investor in a low-income year can harvest aggressively, knowing the losses will be useful when income rises.
However, there is an edge case: death. When an investor dies, the deceased’s estate gets a “step-up in basis.” The executor’s basis for inherited securities is reset to the value at death, not the deceased’s historical cost. This eliminates unrealized losses. So harvesting near end of life has diminishing value, and over-harvesting might leave unused losses that provide no benefit.
State Taxes and Special Cases
Federal wash-sale rules are clear. But some states have different or no wash-sale rules. California, for example, follows federal rules closely. But a few states do not recognize capital loss offsets fully, or have different carryforward rules. An investor in such a state might have federal tax benefit but not state benefit from a harvest.
Also, qualified dividends and long-term capital gains are taxed at favorable rates (0%, 15%, or 20% federal, depending on income). Short-term gains are taxed as ordinary income (up to 37%). This creates incentive to harvest short-term losses (which offset short-term gains, saving at ordinary rates) rather than long-term losses (which offset long-term gains, saving at preferential rates). An investor with a portfolio of long-term winners and short-term losers might prioritize harvesting the short-term losses first.
Automated Harvesting and Risks
Many robo-advisors and tax-aware portfolio managers now automate harvesting. They scan portfolios continuously for losses, identify substitute assets, and execute harvests systematically. This reduces the opportunity cost of manual selection and captures more losses over time.
The risk is mechanical error. An automated system might harvest the same position repeatedly (always switching back to a “similar” asset), creating a tax-reporting nightmare and audit exposure. The IRS has challenged some aggressive harvesting strategies, particularly those that circumvent the wash-sale rule through elaborate substitute purchases that essentially recreate the original position.
Additionally, an automated system might harvest losses in a way that reduces long-term compounding. By switching out of winning positions frequently (to harvest in the losing positions), the investor might underperform a buy-and-hold strategy. The tax savings must exceed the compounding cost for the strategy to add value.
See also
Closely related
- Capital gains tax — federal tax rates on investment profits and timing strategies
- Cost basis — tracking purchase price and calculating gains and losses
- Tax lot — identifying which shares are sold to optimize tax outcomes
- Wash sale — the 30-day rule and its implications
- Marginal tax rate — why effective tax burden varies by income level
Wider context
- Tax-deferred accounts — 401(k) and IRA strategies as alternative to loss harvesting
- Investment company act of 1940 — regulatory constraints on fund behavior, including wash-sale implications
- Discretionary spending — how tax savings can be reinvested or consumed
- Behavioral finance — whether investors actually execute tax-efficient strategies or fall prey to inertia