Tax-Loss Harvesting Explained: Save Thousands on Investment Taxes

I first learned about tax-loss harvesting when I got a $4,200 tax bill on investment gains I hadn't even cashed out yet. That stung. Turns out, if I'd sold some underperforming positions earlier that year, I could have offset those gains and saved a big chunk of that bill. It's not complicated once you understand the rules, but nobody explained it to me in plain English — so here's the guide I wish I'd had. I'll cover how it works, the wash-sale rule that trips people up, and the situations where it actually backfires.

What Is Tax-Loss Harvesting?

Tax-loss harvesting is the practice of selling an investment that has declined in value below your purchase price (your cost basis) to realize a capital loss. That loss is then used to offset capital gains from other investments you sold at a profit during the same tax year. If your total losses exceed your total gains, up to $3,000 of the excess can offset ordinary income (like wages), and any remaining losses carry forward to future years indefinitely.

The key insight is that you are not permanently giving up on the losing investment. After selling, you immediately reinvest the proceeds in a similar (but not identical) investment to maintain your portfolio allocation and market exposure. You stay invested in the market while generating a tax benefit from the paper loss.

Consider this example: You own $50,000 of a total stock market ETF purchased at $55,000 — a $5,000 unrealized loss. You also sold another investment earlier this year with a $5,000 gain. Without harvesting, you owe capital gains tax on that $5,000 gain. With harvesting, you sell the ETF at a $5,000 loss, immediately buy a similar ETF (different fund, same market exposure), and the loss offsets the gain. Net taxable gain: zero. At a 15% long-term rate, you just saved $750 in taxes while keeping essentially the same portfolio. Use our capital gains tax calculator to estimate exactly how much you could save.

How Tax-Loss Harvesting Works Step by Step

Here is the complete process for a single tax-loss harvesting transaction:

  1. Identify a losing position: Review your taxable brokerage account for investments currently trading below your cost basis. Most brokerages show unrealized gains and losses on your holdings page.
  2. Sell the losing investment: Place a sell order for the position. This realizes the loss for tax purposes. The loss is calculated as the sale proceeds minus your cost basis minus any selling costs.
  3. Immediately reinvest in a similar asset: To maintain your portfolio allocation and market exposure, buy a similar investment on the same day. The replacement must not be "substantially identical" to the original (more on this below under the wash-sale rule).
  4. Wait 31 days (if you want to repurchase the original): If you specifically want to own the original investment again, you must wait at least 31 days before repurchasing it. During this time, the replacement investment keeps you invested in the market.
  5. Record the transaction: Your brokerage will report the loss on Form 1099-B at year end. Ensure the cost basis is correct, especially if you have purchased the same security at multiple times and prices.
  6. Report on your tax return: Capital gains and losses are reported on Schedule D and Form 8949. Losses first offset gains of the same type, then the other type, then up to $3,000 offsets ordinary income.

The Wash-Sale Rule: The Critical Rule You Must Follow

The wash-sale rule is the single most important regulation governing tax-loss harvesting. The IRS created it to prevent taxpayers from selling a security at a loss and immediately repurchasing the identical security just to claim the tax deduction while maintaining the exact same position.

The rule: If you sell a security at a loss and purchase the same or a "substantially identical" security within 30 days before or after the sale, the loss is disallowed for tax purposes. The 30-day window runs in both directions — 30 days before the sale, the sale date itself, and 30 days after — creating a 61-day total exclusion window.

What counts as "substantially identical"? The IRS has never provided a precise definition, but the following are generally accepted guidelines:

If you trigger a wash sale, the disallowed loss is not lost forever — it is added to the cost basis of the replacement shares, effectively deferring the tax benefit until you eventually sell those replacement shares. The exception is if the wash sale occurs across a taxable account and an IRA: losses disallowed by a wash sale involving an IRA purchase cannot be added to the IRA's basis, and the deduction is permanently lost.

Capital Gains Offset Rules and the $3,000 Deduction

Understanding how losses offset gains is critical for maximizing the tax benefit. The IRS follows a specific netting order:

  1. Short-term losses offset short-term gains first. If you have $10,000 in short-term gains and $6,000 in short-term losses, your net short-term gain is $4,000.
  2. Long-term losses offset long-term gains first. If you have $8,000 in long-term gains and $12,000 in long-term losses, your net long-term loss is $4,000.
  3. Net losses from one category offset net gains from the other. Using the example above, the $4,000 net long-term loss offsets the $4,000 net short-term gain. Final result: zero taxable capital gains.
  4. Up to $3,000 in net losses offset ordinary income. If after all the netting you still have excess losses, up to $3,000 per year ($1,500 if married filing separately) can be deducted from ordinary income — wages, business income, interest, etc.
  5. Remaining losses carry forward indefinitely. Any losses beyond $3,000 carry forward to next year and follow the same netting process.
Capital Gains Type Tax Rate (Single Filer) Holding Period Tax Savings per $10K Harvested
Short-Term (10% bracket) 10% 1 year or less $1,000
Short-Term (22% bracket) 22% 1 year or less $2,200
Short-Term (32% bracket) 32% 1 year or less $3,200
Short-Term (37% bracket) 37% 1 year or less $3,700
Long-Term (0% rate) 0% More than 1 year $0
Long-Term (15% rate) 15% More than 1 year $1,500
Long-Term (20% + NIIT) 23.8% More than 1 year $2,380

This table illustrates why harvesting short-term losses that offset short-term gains provides the largest benefit — you are offsetting gains taxed at your ordinary income rate, which can be as high as 37%. Harvesting long-term losses to offset long-term gains at the 15% rate still provides meaningful savings but less per dollar.

The $3,000 ordinary income deduction is a powerful ongoing benefit. Even in years when you have no capital gains, you can harvest $3,000 in losses to reduce your taxable wage income. At a 32% bracket, that saves $960 per year — a benefit that compounds over decades. Visit our tax calculator to see how the deduction affects your overall tax bill.

Tax-Loss Harvesting with ETFs

Exchange-traded funds (ETFs) are the ideal vehicle for tax-loss harvesting because the ETF universe offers many similar-but-not-identical pairs that let you maintain your allocation while staying outside the wash-sale rule. Here are commonly used ETF swap pairs:

When swapping ETFs, check that the replacement fund tracks a sufficiently different index, has reasonable expense ratios, and has adequate trading volume. The goal is to maintain nearly identical market exposure while using a technically different product.

Automated vs Manual Tax-Loss Harvesting

Robo-advisors like Wealthfront, Betterment, and Schwab Intelligent Portfolios offer automated daily tax-loss harvesting as a core feature. They monitor your portfolio continuously and execute swaps whenever an investment drops below its cost basis by a meaningful amount. This captures more opportunities than manual harvesting, which most individual investors do only once or twice a year (typically in December).

Wealthfront reports that their automated harvesting generates tax savings of 1.5% to 2.0% of portfolio value per year for typical clients, though results vary with market volatility and portfolio size. Betterment reports similar figures. These savings more than offset the 0.25% annual management fee charged by most robo-advisors.

However, manual harvesting works well too — especially during significant market downturns when paper losses are large. The 2020 COVID crash, the 2022 bear market, and any sharp correction create ideal harvesting opportunities. If you invest primarily in a few broad-market ETFs, monitoring them monthly and harvesting when losses exceed 5% to 10% captures most of the available benefit.

Whether automated or manual, track your cost basis carefully. Tax-lot-level tracking (knowing the purchase price of each individual lot of shares) maximizes your ability to harvest specific lots with losses while retaining lots with gains.

When NOT to Harvest Losses

Tax-loss harvesting is not always beneficial. Here are situations where it can actually cost you money or create complications:

Explore our investment calculator to model how after-tax returns with harvesting compare to pre-tax returns without it over your investment timeline.

Frequently Asked Questions

What is the wash-sale rule and how does it affect tax-loss harvesting?

The wash-sale rule prevents you from claiming a tax loss if you buy the same or substantially identical security within 30 days before or after the sale — a 61-day total window. If triggered, the disallowed loss is added to the cost basis of the replacement shares, deferring the benefit. The rule applies across all accounts including IRAs. To comply, buy a similar but not identical investment after selling.

How much can tax-loss harvesting save me in taxes?

Savings depend on your bracket and the amount harvested. Offsetting $20,000 in long-term gains at 15% saves $3,000. Offsetting $20,000 in short-term gains at 32% saves $6,400. The $3,000 ordinary income deduction saves $720 to $1,110 per year. Over a decade of consistent harvesting, cumulative savings can reach $10,000 to $50,000 or more for large portfolios.

Can I tax-loss harvest in my IRA or 401(k)?

No. Tax-loss harvesting only works in taxable brokerage accounts. Gains and losses inside IRAs, 401(k)s, and other tax-advantaged accounts are not taxable or deductible in the current year. Be careful: the wash-sale rule applies across account types, so buying the same security in your IRA within 30 days of selling at a loss in your taxable account permanently disallows the loss.

Sources & further reading

Claims in this article are cross-checked against the following primary sources. Links open on the publisher's site.

  1. IRS — About Form W-2

    Official IRS reference for W-2 wage and tax statements, with current-year instructions.

  2. IRS — Publication 17 (Your Federal Income Tax)

    Comprehensive guide to filing individual federal income taxes.

  3. IRS — Tax Withholding Estimator

    Official tool for verifying paycheck withholding accuracy.

  4. IRS — Tax Topic 409 (Capital Gains and Losses)

    Authoritative source for short-term and long-term capital gains tax treatment.

  5. CFPB — Filing Your Taxes

    Consumer Financial Protection Bureau guidance on tax-filing essentials.