All Resources
Tax Planning

Tax-Gain Harvesting: Locking In the 0% Capital Gains Rate

7 min read

The Core Idea

Tax-gain harvesting is the mirror image of tax-loss harvesting. Instead of selling losers to bank a deductible loss, you deliberately sell winners in a year when your income is low enough that the long-term capital gains fall into the 0% federal bracket. You immediately rebuy the same position, resetting your cost basis higher — for free.

There is no wash sale rule on gains. You can sell an appreciated position and buy it back the same minute. The only thing you're "harvesting" is a higher cost basis, which reduces the taxable gain on a future sale.

Why the 0% Bracket Exists

Long-term capital gains (assets held more than one year) are taxed at 0%, 15%, or 20% depending on your taxable income. The 0% bracket is real and generous, but it's stacked on top of your ordinary income. Long-term gains fill up the bracket space that's left after your ordinary income is counted.

For 2025, the 0% long-term capital gains rate applies to taxable income up to:

  • $48,350 — single
  • $96,700 — married filing jointly

Always confirm the current-year thresholds before acting — these figures are indexed for inflation and change annually.

How It Works: Step by Step

Step 1 — Estimate your taxable income for the year. Add up wages, interest, dividends, retirement distributions, and any other ordinary income, then subtract your standard or itemized deduction. This is the number that determines how much 0%-bracket room you have.

Step 2 — Calculate your remaining 0% room. Subtract your taxable ordinary income from the top of the 0% bracket. If you're married filing jointly with $60,000 of taxable income, you have roughly $96,700 − $60,000 = $36,700 of space to realize long-term gains at 0%.

Step 3 — Sell appreciated long-term positions up to that limit. Only positions held more than one year qualify for long-term rates. Realize gains up to (but not exceeding) your remaining 0% room.

Step 4 — Immediately rebuy. Repurchase the same security right away. Because there's no wash sale rule for gains, your market exposure never changes. Your new cost basis is the repurchase price.

Step 5 — Repeat annually. Each low-income year is a fresh opportunity to step up basis at 0%.

Concrete Example

Suppose you're married filing jointly, recently retired, and living off cash savings this year before Social Security and RMDs begin. Your taxable income is $40,000 after the standard deduction.

You hold 500 shares of a total market ETF bought years ago at $100/share ($50,000 basis), now worth $180/share ($90,000 value) — a $40,000 unrealized long-term gain.

Your 0% room: $96,700 − $40,000 = $56,700.

You sell shares to realize $56,700 of gain — that's about 315 shares at the $80/share embedded gain. You immediately rebuy those shares at $180.

Tax on the harvested gain: $0. Your basis on the repurchased shares is now $180 instead of $100. If you sell them later in a higher-income year, you'll owe capital gains tax only on appreciation above $180 — you permanently erased the tax on $56,700 of gain.

Without harvesting, that $56,700 gain would eventually be taxed at 15% ($8,505) or more once your income rose in retirement.

The Critical Trap: Gains Push Up Your Own Income

This is the mistake that turns a free lunch into a tax bill. The capital gains you harvest count as income when determining which bracket the rest of your gains fall into. If you realize more than your 0% room, the excess spills into the 15% bracket.

Harvest $56,700 when you only had $56,700 of room, and every dollar is tax-free. Harvest $70,000, and roughly $13,300 gets taxed at 15%. There's no penalty for the spillover beyond the normal 15% rate, but the whole point is to stay at 0% — so estimate carefully and leave a cushion.

The Second-Order Effects Most People Miss

Realized gains raise your Adjusted Gross Income (AGI), even when the gains themselves are taxed at 0%. A higher AGI can quietly cost you elsewhere:

  • ACA health insurance subsidies. If you buy coverage on the marketplace, premium tax credits phase out as income rises. A large gain harvest can slash or eliminate your subsidy — often costing far more than the tax you saved.
  • Social Security taxation. Higher AGI can push more of your Social Security benefits into the taxable range.
  • IRMAA (Medicare premium surcharges). For those 63+, this year's AGI determines Medicare Part B and D premiums two years later. A big harvest can trigger surcharges.
  • Other income-tested items — the Saver's Credit, education credits, and student loan interest deductions can all phase out.

For pre-Medicare early retirees on an ACA plan, the lost subsidy frequently makes gain harvesting a net loser. Run the full picture, not just the capital gains line.

Who Should Consider It

Tax-gain harvesting shines for people with temporarily low taxable income and appreciated assets in a taxable brokerage account:

  • Early retirees living on cash or Roth withdrawals in the gap years before Social Security and RMDs begin.
  • People between jobs or taking a sabbatical / gap year.
  • Students and residents with low current income but appreciated holdings.
  • Business owners in a down year.
  • Anyone whose income dipped temporarily below the 0% threshold.

Who Should Skip It

  • The 0% bracket doesn't apply to you. If your income already exceeds the threshold, harvesting realizes gains at 15% or 20% for no benefit — you'd just be prepaying tax.
  • You're on an ACA marketplace plan where the subsidy loss exceeds the tax saved.
  • You may donate the assets or leave them to heirs. Appreciated shares donated to charity avoid capital gains entirely, and assets held until death get a step-up in basis — heirs inherit them at market value, erasing the unrealized gain. Harvesting first wastes that benefit.
  • Your holdings are already in tax-advantaged accounts. Gains inside 401(k)s and IRAs aren't taxed on realization, so there's nothing to harvest.

Gain Harvesting vs. Loss Harvesting

They're two sides of the same timing lever, applied in different years:

  • Tax-loss harvesting — done in high-income years or after market declines. Sell losers, bank the loss to offset gains and up to $3,000 of ordinary income. Watch the wash sale rule (no rebuying substantially identical securities within 30 days).
  • Tax-gain harvesting — done in low-income years. Sell winners at 0%, rebuy immediately to reset basis higher. No wash sale rule applies.

A well-run taxable account uses both across a lifetime: harvest losses while you're working and in a high bracket, harvest gains during low-income gap years.

Practical Execution: A Checklist

  1. Project your full-year taxable income before December — wages, interest, dividends, distributions, minus deductions.
  2. Calculate your 0% room using the current-year threshold for your filing status.
  3. Model the AGI side effects — ACA subsidies, IRMAA (if 63+), and Social Security taxability — before committing.
  4. Confirm the holding period. Only positions held more than one year get long-term rates. Short-term gains are taxed as ordinary income and defeat the purpose.
  5. Use specific identification (SpecID) to sell the highest-basis lots if you want to realize a precise gain amount.
  6. Sell up to your 0% room, leaving a cushion so year-end dividends or a bad income estimate don't push you into the 15% bracket.
  7. Rebuy immediately — same day, same security. No waiting period is required.
  8. Repeat each qualifying year. The benefit compounds as you keep resetting basis higher, tax-free.

Key Takeaway

Tax-gain harvesting is the rare move that lets you pay tax voluntarily — at a rate of zero — to make future tax bills smaller. It's most powerful in low-income gap years, and it carries no wash sale restriction, so staying invested is trivial. The catch is that realized gains inflate your AGI, which can ripple into ACA subsidies, Medicare premiums, and Social Security taxation. Do the full-picture math first; when it fits, it's one of the cleanest ways to lock in permanent tax savings.

Related Reading