Get Answers
TAXES

Tax-Loss Harvesting: How to Offset Capital Gains & Reduce Your Tax Bill

Tax-loss harvesting is the deliberate sale of underperforming securities at a realized loss to offset taxable capital gains elsewhere in a portfolio, reducing current year federal and state income tax liability while maintaining substantially the same market exposure through reinvestment.

By Maya Lin-Donahue, CPA, MST • Reviewed by Gregory Sloan, CPA, PFS • Updated November 4, 2026
Tax-Loss Harvesting: How to Offset Capital Gains & Reduce Your Tax Bill

Key Takeaways

  • Capital losses offset capital gains dollar-for-dollar — first against gains of the same type (short vs. long), then against the opposite type, then up to $3,000 against ordinary income.
  • The IRS Wash-Sale Rule prohibits claiming a loss if you buy the 'substantially identical' security within 30 days before or after the sale — but purchasing a highly correlated ETF is typically acceptable.
  • Net capital loss carryforwards roll indefinitely into future tax years — there is no expiration on unused losses.
  • Tax-loss harvesting adds the most value for high-income investors in the 24%–37% bracket who also face the 3.8% NIIT surtax on investment income.

Tax-loss harvesting converts a portfolio setback into a tax asset — transforming an unrealized loss on a declining security into a tangible reduction in your current-year tax bill, while maintaining substantively unchanged market exposure through immediate reinvestment in a correlated replacement asset.

How Tax-Loss Harvesting Works: Step-by-Step

Step 1: Identify positions with unrealized losses Review your taxable brokerage account for securities currently trading below their cost basis.

Step 2: Sell the losing position Execute the sale, locking in the realized capital loss.

Step 3: Immediately reinvest in a correlated substitute To maintain market exposure and avoid the wash-sale rule, immediately purchase a similar (but not “substantially identical”) security — such as a competing ETF from a different fund family covering the same index.

Step 4: Wait 30 days before repurchasing the original If you want to return to the original security, you must wait 31+ days after the sale to avoid a wash-sale disallowance.

Tax-Loss Harvesting Netting Rules: Priority Order

The IRS mandates a specific sequencing for how gains and losses offset each other:

  1. Short-term losses first offset short-term gains (taxed at ordinary income rates)
  2. Long-term losses first offset long-term gains (taxed at preferential rates)
  3. If a net loss remains in one category, it offsets gains in the other
  4. Net capital losses above all gains offset up to $3,000 of ordinary income
  5. Any remaining net loss carries forward indefinitely to future tax years

Priority Insight: Short-term losses are most valuable because they offset short-term gains taxed at up to 37% — generating nearly double the tax savings per dollar compared to offsetting long-term gains taxed at 15%.

Real-World Example: Tax-Loss Harvesting in Action

Scenario: Marcus, a software engineer with $280,000 income (32% federal bracket + 3.8% NIIT):

Taxable brokerage account positions:

SecurityPurchase PriceCurrent PriceUnrealized Gain/Loss
Technology ETF (XLK)$180.00$155.00–$12,500 (loss)
Individual stock (AMZN)$125.00$186.00+$30,500 (gain)
Index Fund (VOO)$340.00$412.00+$18,200 (gain)

Without harvesting: Marcus sells AMZN and VOO → $48,700 total gains

  • Long-term capital gains tax: $48,700 × 20% = $9,740
  • NIIT: $48,700 × 3.8% = $1,851
  • Total Tax: $11,591

With harvesting: Marcus also sells XLK at a $12,500 loss

  • Net taxable gain: $48,700 − $12,500 = $36,200
  • Capital gains tax: $36,200 × 20% = $7,240
  • NIIT: $36,200 × 3.8% = $1,376
  • Total Tax: $8,616

Tax Savings from Harvesting: $11,591 − $8,616 = $2,975

Marcus immediately reinvests the XLK sale proceeds into a highly correlated technology ETF (such as VGT — Vanguard Information Technology ETF) to maintain market exposure, avoiding the wash-sale disallowance.

The Wash-Sale Rule: 30-Day Restriction Zone

[ 30 days before sale ]──[ SALE DATE ]──[ 30 days after sale ]
         ↑                                        ↑
  Cannot buy substantially identical security in this 61-day window

What counts as “substantially identical” (triggering wash-sale)?

  • The exact same stock or fund
  • Options to buy the same stock (if exercised during the window)
  • Mutual fund shares from the same fund

What does NOT trigger the wash-sale rule?

  • ETF from a different fund family tracking the same index (SPY → VOO)
  • ETF from a different index with high correlation (e.g., total market vs. S&P 500)
  • Individual stocks in the same sector (selling one tech stock, buying another)

Advantages & Disadvantages of Tax-Loss Harvesting

AdvantagesDisadvantages
Immediate reduction in current-year tax liabilityRequires careful 30-day wash-sale rule management
Defers taxes (not permanently avoids unless stepped-up basis)Tracking replacement securities and basis adds administrative complexity
$3,000/year ordinary income deduction is a guaranteed benefitOnly valuable in taxable accounts — no benefit inside IRAs/401(k)s
Loss carryforward persists indefinitelyMay disrupt target asset allocation if not carefully managed
Robo-advisors automate daily harvesting efficientlyShort-term losses more valuable than long-term losses — not always available

Coordinating Loss Harvesting with Estate Planning

Tax-loss sales directly mitigate annual Capital Gains Tax burdens. However, investors must adhere strictly to the 30-day Wash-Sale Rule and consider whether highly appreciated assets should instead be retained to receive a Step-Up in Basis for future heirs.

Frequently Asked Questions

What is the wash-sale rule and how does it affect tax-loss harvesting?
The IRS wash-sale rule (Section 1091) disallows a tax loss if you purchase the same or 'substantially identical' security within 30 days before or after the sale at a loss. The disallowed loss is not permanently lost — it's added to the cost basis of the repurchased shares, deferring the deduction.
What is the $3,000 capital loss deduction limit?
If your total capital losses for the year exceed your total capital gains, you can deduct up to $3,000 of net capital losses against ordinary income (wages, salary) annually. Any excess losses above $3,000 carry forward indefinitely to future tax years.
What is the correct order for netting capital gains and losses?
The IRS netting process: First, net short-term gains against short-term losses. Then, net long-term gains against long-term losses. Finally, if one side produces a net gain and the other a net loss, they offset each other — the net result is either a net short-term or long-term gain/loss.
What securities can I buy to avoid the wash-sale rule?
You can buy ETFs or funds in the same sector or index without triggering the wash-sale rule, as long as they are not 'substantially identical.' For example, selling the SPDR S&P 500 ETF (SPY) at a loss and immediately buying the Vanguard S&P 500 ETF (VOO) is generally considered acceptable.
Does tax-loss harvesting make sense in a tax-advantaged account?
No. Tax-loss harvesting has no value inside IRAs, 401(k)s, or Roth IRAs because gains and losses inside these accounts do not affect your personal tax return. TLH only applies to taxable brokerage accounts where capital gains and losses flow through to your personal tax return.

The Bottom Line

Understanding Tax-Loss Harvesting is essential for making sound financial decisions in today's complex markets. The core mechanics, formulas, and real-world scenarios outlined in this guide are regularly reviewed and updated by our credentialed editorial team to reflect the current 2026 rate environment and regulatory landscape. Whether you are a retail investor building long-term wealth or a finance professional sharpening technical knowledge, applying these principles with consistent discipline separates informed decision-making from costly financial mistakes.

Editorial & Financial Disclaimer: TXTIA is an independent financial education and research publisher. The educational content, calculations, and scenarios presented on this page are for informational purposes only and do not constitute individual investment, legal, or tax advice. Consult a licensed fiduciary financial advisor (CFP®) or certified public accountant (CPA) regarding your specific financial situation.