Taxes · Guide

Tax-Loss Harvesting Explained: How to Use Losses to Lower Your Tax Bill

Tax-loss harvesting sells investments at a loss to offset capital gains, legally reducing your tax bill while keeping your portfolio essentially unchanged. Here's how it works, the wash-sale rule to avoid, and when it makes sense.

·Jun 30, 2026·4 min read
Rate data reviewed recently·Methodology →
30 days
Wash-sale window
Before and after the sale
$3,000
Ordinary income offset
Per year, losses beyond gains
15%+
Capital gains rate
Where harvesting adds real value

Bottom line: Tax-loss harvesting sells investments at a loss, uses those losses to offset capital gains, and immediately buys a similar (but not identical) investment to maintain the same market exposure. Done correctly, it defers or eliminates taxes with no meaningful change to your long-term investment position.


Tax-loss harvesting is one of the few tax strategies that generates real savings without changing your investment outcome. The concept: sell an investment that is down in value, capture the paper loss as a tax deduction, and buy a similar investment to maintain your market position.

The Basic Mechanics

Step 1: Identify investments in your taxable account that are worth less than you paid (unrealized losses).

Step 2: Sell them, realizing the loss.

Step 3: Use the loss to offset capital gains realized elsewhere in your portfolio.

Step 4: Buy a similar, but not "substantially identical," investment to stay invested.

Example:

  • You own 100 shares of Vanguard S&P 500 ETF (VOO) purchased at $400/share ($40,000 basis)
  • Current price: $340/share, portfolio value $34,000, unrealized loss: $6,000
  • You sell all shares, realizing a $6,000 capital loss
  • You immediately buy iShares S&P 500 ETF (IVV) for $34,000, tracking the same index
  • The $6,000 loss offsets $6,000 of capital gains elsewhere, saving you $900 in taxes (at 15% rate)
  • Your portfolio is effectively unchanged, still 100% S&P 500 exposure

How Losses Offset Gains

Capital losses offset capital gains dollar-for-dollar. The netting rules:

  1. Short-term losses offset short-term gains first
  2. Long-term losses offset long-term gains first
  3. Excess short-term losses can offset long-term gains (and vice versa)
  4. If total losses exceed total gains, up to $3,000 of net losses can offset ordinary income per year
  5. Losses beyond $3,000 carry forward indefinitely to future tax years

The $3,000 ordinary income offset is available every year, meaning ongoing loss carryforwards continue providing benefit until exhausted.

Key Takeaways
  • Tax-loss harvesting only works in taxable brokerage accounts. Losses inside IRAs and 401(k)s are not deductible, because gains and losses inside tax-advantaged accounts are invisible to the IRS until withdrawal.
  • The wash-sale rule (30 days before and after the sale) prevents buying the same or 'substantially identical' security. Buying the same ETF back immediately disallows the loss. Waiting 31 days or buying a different-but-similar fund avoids the rule.
  • Harvesting losses defers taxes; it does not eliminate them. Your new investment has a lower cost basis, meaning future gains will be larger. The benefit is the time value of the deferred tax and potentially converting short-term gains to long-term.

The Wash-Sale Rule

The IRS disallows a loss if you buy the same or "substantially identical" security within 30 days before or after the sale (a 61-day window total). This is the critical rule to understand.

What triggers the wash-sale rule:

  • Selling VOO (Vanguard S&P 500 ETF) and buying SPY (SPDR S&P 500 ETF), same index, considered substantially identical by many tax professionals; avoid
  • Selling an individual stock and buying it back within 30 days
  • Selling a mutual fund and buying the same fund's ETF equivalent

What does NOT trigger it:

  • Selling VOO and buying IVV (iShares S&P 500 ETF), different products tracking the same index (common practice, though consult a tax advisor)
  • Selling a total U.S. market fund and buying an S&P 500 fund (different indices)
  • Selling a bond fund and buying a different bond fund with similar duration and credit quality

If the wash-sale rule is triggered, the disallowed loss is added to the basis of the replacement security; it is not permanently lost, just deferred.

When It Is Worth Doing

Tax-loss harvesting is most valuable when:

  • You have realized capital gains to offset in the same year
  • You are in a tax bracket where capital gains are taxed (15% or higher)
  • The market decline is meaningful (harvesting $500 in losses for $75 in tax savings is not worth the effort)
  • You can identify a suitable replacement investment to maintain exposure

It is less valuable when:

  • You have no capital gains to offset and are already using the $3,000 ordinary income deduction
  • Your investments are inside tax-advantaged accounts
  • Transaction costs and effort exceed the tax benefit

Robo-advisors (Betterment, Wealthfront) automate tax-loss harvesting continuously, a legitimate reason to consider them for taxable accounts.


Tax-loss harvesting involves complex tax rules. Consult a tax advisor before executing, particularly regarding the wash-sale rule.

Frequently Asked Questions

Does tax-loss harvesting work in a 401(k) or IRA?
No. Tax-loss harvesting only applies to taxable brokerage accounts. Gains and losses inside a 401(k), Traditional IRA, or Roth IRA are not visible to the IRS until you withdraw, so there is no loss to harvest and no deduction to claim.
What is the wash-sale rule?
The IRS disallows a loss if you buy the same or a substantially identical security within 30 days before or after the sale, a 61-day window in total. If you trigger it, the disallowed loss is not gone; it is added to the cost basis of the replacement security and recovered later.
How much can tax-loss harvesting save me?
It depends on your tax bracket and how much loss you realize. Losses offset capital gains dollar for dollar, and up to $3,000 of net losses beyond that can offset ordinary income each year, with any excess carrying forward indefinitely to future tax years.
Is tax-loss harvesting worth doing for a small loss?
Usually not. Harvesting $500 in losses to save $75 in taxes rarely justifies the effort and transaction cost. It becomes worthwhile when the loss is meaningful relative to your tax bracket and you already have gains elsewhere to offset.
Next step
Find your best money move in 90 seconds.

Answer a few questions about your situation and goals. Money Map points you to the highest-value next step across savings, mortgage, cards, and debt.

Editorial review

What changed since the last update

Reviewed dataRate references, product links, and dated claims were checked against current SwitchWize sources.
Updated contextRelated calculators, Money Map paths, and offer links were refreshed for this article topic.
StandardsReviewed under the SwitchWize editorial policy. See standards →

Was this guide helpful?