Skip to main content
All Articles
Financial Guide
6 min read June 4, 2026
Verified June 2026

How to Calculate Tax-Loss Harvesting Savings in Your Portfolio

Most investors watch losses sit in their portfolio and do nothing. That inaction costs them thousands in avoidable taxes every single year. Tax-loss harvesting converts those losses into real, spendable savings, and the math is straightforward once you know it.

How to Calculate Tax-Loss Harvesting Savings in Your Portfolio

Key Takeaways

  • A $50,000 harvested loss can save a top-bracket investor $18,500 in federal taxes in a single year.
  • Investors who skip harvesting and sell winning positions without offsetting losses overpay capital gains tax by an average of 23.8% of the gain at the highest federal rate.
  • Match realized losses against realized gains first, then apply up to $3,000 annually against ordinary income, and carry forward the remainder indefinitely.
  • Tool: Run your tax-loss harvesting numbers now →

File Smarter This YearSPONSORED

Stop leaving money on the table. TurboTax finds every deduction automatically.

INTERACTIVE // Calculator
FULL SCREEN
LOADING Calculator...

What Tax-Loss Harvesting Actually Does

Tax-loss harvesting is a deliberate sale. You sell a security at a loss, realize that loss on paper, and use it to offset taxable gains elsewhere in your portfolio. The IRS treats the offset as a reduction in your net capital gain. A lower net gain means a lower tax bill. The position you sold can be replaced with a comparable, not identical, security to maintain your market exposure.

The key word is "realized." Unrealized losses provide zero tax benefit. They must be crystallized through an actual sale before December 31 of the tax year in which you want to claim them.

This is not a strategy for small portfolios. The mechanics reward investors with taxable accounts, meaningful positions, and capital gains to offset. If those three conditions describe your situation, the dollar impact is material.

The Core Calculation: Step by Step

The calculation follows four steps. Each step produces a specific number you can verify.

Step 1: Determine your realized capital losses. This is your cost basis minus your sale proceeds. If you bought 500 shares of a fund at $80 and sold at $62, your realized loss is $9,000. Cost basis tracking method matters here. Specific identification typically produces the largest harvestable loss.

Step 2: Identify your realized capital gains for the year. Separate short-term gains (held under 12 months) from long-term gains (held 12 months or more). The IRS taxes them at different rates. Short-term gains are taxed as ordinary income, up to 37% federally. Long-term gains are taxed at 0%, 15%, or 20% depending on income, plus a potential 3.8% net investment income tax for high earners.

Step 3: Apply losses against gains in the correct order. The IRS requires you to net losses against gains of the same type first. Short-term losses offset short-term gains. Long-term losses offset long-term gains. If you have excess losses in one category, they cross over to offset gains in the other category. This ordering matters because short-term gains carry a higher tax cost. A short-term loss offsetting a short-term gain saves more per dollar than the same loss applied to a long-term gain.

Step 4: Apply remaining losses against ordinary income. After exhausting all capital gain offsets, net losses reduce ordinary income by up to $3,000 per year. Any amount beyond $3,000 carries forward to future tax years with no expiration.

Worked Example 1: High-Income Investor with Mixed Gains

Consider an investor in the 37% ordinary income bracket with the following 2025 activity in a taxable brokerage account.

  • Short-term gain: $28,000 (tech stock sold after 9 months)
  • Long-term gain: $45,000 (index fund held for 4 years)
  • Realized loss available to harvest: $38,000 (two losing bond fund positions)

The investor applies the $38,000 loss against the $28,000 short-term gain first. This eliminates the short-term gain entirely. The remaining $10,000 of loss crosses over and offsets $10,000 of the long-term gain.

Net capital gain position after harvesting:

  • Short-term gain: $0
  • Long-term gain: $35,000 ($45,000 minus $10,000)

Without harvesting, the tax calculation would be:

  • $28,000 at 37% (short-term): $10,360
  • $45,000 at 23.8% (20% + 3.8% NIIT): $10,710
  • Total tax: $21,070

With harvesting, the tax calculation is:

  • $0 short-term gain: $0
  • $35,000 at 23.8%: $8,330
  • Total tax: $8,330

Tax savings from harvesting: $12,740 in a single year.

That is not deferred. That is eliminated for the current tax year. The replacement securities maintain market exposure, so the investor does not sacrifice investment returns to capture the benefit.

Worked Example 2: Mid-Income Investor with Carryforward

An investor in the 22% federal bracket has no capital gains in 2025 but holds two positions with unrealized losses totaling $21,000. She harvests both positions in December.

Year 1 application:

  • $3,000 applied against ordinary income. Tax savings at 22%: $660.
  • Remaining $18,000 carried forward.

Year 2: She sells a concentrated stock position with a $14,000 long-term gain.

  • $14,000 of carryforward offsets the entire gain.
  • Tax savings at 15% long-term rate: $2,100.
  • Remaining carryforward: $4,000.

Year 3: She applies another $3,000 against ordinary income.

  • Tax savings at 22%: $660.
  • Remaining carryforward: $1,000.

Year 4: Final $1,000 applied against ordinary income.

  • Tax savings at 22%: $220.

Total tax saved across four years from one $21,000 harvesting decision: $3,640.

The time value is real. Savings in year 1 are worth more than savings in year 4. But the carryforward mechanism means no harvested loss ever goes to waste. Every dollar of loss eventually produces a tax benefit.

The Wash-Sale Rule: Where the Math Breaks Down

The IRS wash-sale rule disallows a loss if you buy a "substantially identical" security within 30 days before or after the sale. The 30-day window runs in both directions. Violating it does not create a penalty. It defers the loss. The disallowed loss adds to the cost basis of the replacement security. But deferral destroys the current-year tax benefit you were trying to capture.

Practically, this means:

  • You cannot sell a Vanguard S&P 500 ETF and buy a SPDR S&P 500 ETF within the 30-day window. They track the same index and the IRS considers them substantially identical.
  • You can sell a Vanguard S&P 500 ETF and buy a Vanguard Total Market ETF. Different index, different holdings, different security.
  • Individual stocks are generally safe to replace with sector ETFs.

Automated harvesting platforms track wash-sale exposure across all accounts, including IRAs. A loss harvested in a taxable account is permanently disallowed, not deferred, if you purchase the identical security in a linked IRA within the wash-sale window. That is a permanent loss of the tax benefit.

How Bracket Thresholds Shift the Numbers

The value of harvesting scales with your marginal tax rate on the gains being offset. Two investors harvesting the same $25,000 loss produce very different outcomes.

InvestorGain Type OffsetRate AppliedTax Saved
Investor A (37% bracket)Short-term37%$9,250
Investor B (22% bracket)Short-term22%$5,500
Investor A (37% bracket)Long-term23.8%$5,950
Investor B (22% bracket)Long-term15%$3,750

The math favors high earners significantly. But mid-income investors with meaningful taxable accounts still capture thousands in annual savings. The carryforward feature makes harvesting worthwhile even in years with no gains to offset.

State taxes compound the benefit further. California's 13.3% top rate and New York City's combined rate above 14% mean a top-bracket investor in either state can add another $3,000 to $4,000 in savings per $25,000 of harvested short-term loss.

What the Replacement Security Decision Costs You

Harvesting is not free. Transaction costs, bid-ask spreads, and potential tracking error between your original holding and the replacement security all reduce net benefit. For a $50,000 harvested loss generating $11,900 in federal tax savings, a 0.5% round-trip transaction cost on the replacement purchase amounts to $250. That is immaterial. But if the replacement security underperforms your original holding by 2% annualized over three years, the opportunity cost reaches $3,000 on a $50,000 position. Security selection quality matters.

The better the replacement security tracks your original holding's return profile, the closer your realized tax savings approach the theoretical maximum.

How Often to Harvest

Many investors treat harvesting as a year-end exercise. This is suboptimal. Losses large enough to harvest often appear during intra-year drawdowns and recover before December. Monitoring positions quarterly at minimum captures opportunities that a December review misses entirely. During high-volatility years, monthly scans of the largest losing positions can identify harvesting candidates that would not exist three months later.

The 2022 calendar year offers a concrete example. The S&P 500 fell more than 20% through mid-October and partially recovered by year-end. Investors who waited until December to assess harvesting opportunities found significantly smaller losses to capture than those who acted in October.

Run Your Own Numbers

The specific tax savings from harvesting depend on four variables: the size of your realized losses, the type and size of your gains, your marginal federal and state tax rates, and the timing within the tax year. General rules produce approximate answers. Your actual situation requires exact inputs.

The CalcMoney income tax calculator accepts your actual gain and loss figures and applies the correct federal rate brackets, including the 3.8% net investment income tax threshold, to produce a precise tax liability comparison. Enter your portfolio figures before and after hypothetical harvesting decisions to see the exact dollar difference.

Calculate your tax-loss harvesting savings now →

You Might Also Like

The number the calculator returns is the amount you are currently scheduled to send to the IRS that you do not have to. That figure is worth knowing before December 31.

FEATURED PARTNERFIDELITY

Put These Numbers to Work

Open a Fidelity brokerage account. $0 commissions, no account minimums, fractional shares available.

Run the Numbers →
or

One money insight per week.

Calculator deep-dives, rate alerts, and financial analysis written for real decisions. Unsubscribe anytime.

1 email/week. No spam. Unsubscribe in one click.

Free Tools

Run the actual numbers

Stop estimating. Plug in your numbers and get a precise answer in seconds. Free, no signup required.

Open Free Calculators