Retiree Advisor Match

Capital Gains Tax in Retirement: How to Harvest Gains Tax-Free

Most retirees don't realize they can sell appreciated stock, mutual funds, or ETFs and owe zero in federal capital gains tax — legally, intentionally, and repeatedly. The 0% long-term capital gains rate is one of the most powerful and underused tools in retirement tax planning. Here's exactly how it works, who qualifies in 2026, and how to calculate how much you can harvest.

The 0% capital gains rate: what it is and why retirees benefit most

Long-term capital gains — profits from selling assets held longer than one year — are taxed at preferential rates: 0%, 15%, or 20%, depending on your taxable income. For 2026, the 0% rate applies if your total taxable income (including the gains themselves) stays below:1

Filing status0% rate up to15% rate up to20% rate above
Single$49,450~$533,400~$533,400
Married filing jointly$98,900~$616,050~$616,050

2026 thresholds per IRS Rev. Proc. 2025-32. These are taxable income thresholds — after the standard deduction ($16,100 single / $32,200 MFJ) or itemized deductions.

Retirees in the early years of retirement — especially the window between age 60 and 73 when RMDs begin — often have low taxable income because they're not yet drawing large Social Security benefits, haven't started RMDs, and can control their withdrawal amounts. This is precisely when the 0% rate is accessible, and when intentionally realizing gains (called tax gain harvesting) can eliminate capital gains tax permanently.

The core idea: You sell appreciated assets, owe $0 in capital gains tax, then immediately rebuy the same or similar assets at the new higher price. Your cost basis resets. Those gains are permanently eliminated — for you and, under current law, for your heirs who receive a step-up in basis at death. You just need taxable income low enough to stay within the 0% threshold.

2026 tax gain harvesting calculator

Enter your 2026 taxable income from ordinary sources (pensions, wages, traditional IRA or 401(k) withdrawals, the taxable portion of Social Security) and the long-term gains available to harvest. This is your taxable income — after the standard deduction or your itemized deductions.

Tax Gain Harvesting Calculator — 2026


$0
Gains harvestable at 0%
$0
Gains taxed at 15%
$0
Total capital gains tax owed
$0
Tax saved vs. waiting for higher-rate year
Gains breakdown:
0% rate   15% rate

Estimates only. Does not account for state taxes, AMT, or multi-year planning interactions. Consult a tax professional before executing gain harvesting transactions.

How to read the calculator: a real example

Take a married couple, both age 67, retired, with:

Their taxable income before gains: $20,400 (SS) + $42,000 (pension) − $32,200 (standard deduction) = $30,200.

The 0% LTCG threshold for MFJ is $98,900. Their available harvesting space: $98,900 − $30,200 = $68,700.

They hold $85,000 in unrealized gains in a taxable brokerage account. They harvest $68,700 of those gains at 0% and leave the remaining $16,300 unharvested (or harvest it at 15% = $2,445). They immediately rebuy the same ETFs at the higher price. Their basis is now $68,700 higher. If they eventually sell at a 15% rate in a higher-income year, or their heirs inherit at a stepped-up basis, those gains are gone permanently.

Tax on $68,700 of gains: $0. Tax savings vs. waiting for an RMD-heavy year: $68,700 × 15% = $10,305.

Why the pre-RMD window (ages 60–73) is the best time

RMDs don't begin until age 73 (or 75 if you were born in 1960 or later, per SECURE 2.0).2 Before that, a retiree who has stopped working controls their ordinary income almost entirely through choices: pension, Social Security timing, and how much they withdraw from traditional accounts. Many retirees in this window have surprisingly low taxable income — especially if they delay Social Security to 70 and live partially off taxable or Roth accounts in the interim.

Once RMDs begin, ordinary taxable income rises automatically each year as the IRS-mandated withdrawals kick in. A retiree with a $1.5M IRA faces an RMD of roughly $54,000 at age 73 (balance ÷ 26.5, per IRS Uniform Lifetime Table). By age 80, RMDs from that same account could be $85,000–$100,000+. That additional income consumes the 0% bracket space and pushes gains into the 15% range — or higher, plus IRMAA.

The window to harvest at 0% is widest between retirement and the first RMD. Every year you don't harvest in that window is a year you don't get back.

The wash sale rule does NOT apply to gains

The wash sale rule disallows a capital loss if you rebuy substantially identical securities within 30 days. It applies only to losses. When harvesting gains, there is no wash sale problem: you can sell an ETF at a gain and immediately rebuy it. Your shares are identical, you pay zero in taxes if within the 0% bracket, and your cost basis resets to today's price.

The one practical consideration: if you sell and rebuy on the same day in a taxable account, you're realizing gains. Make sure those gains stay within your 0% space for the year before executing. Some investors harvest in December when they have a clearer picture of their full-year income; others spread it across the year to avoid surprises.

Roth conversions vs. gain harvesting: they compete for the same bracket space

Both Roth conversions and capital gain harvesting consume tax bracket space. A Roth conversion shows up as ordinary income; harvested gains show up as capital gains income — both affect your total taxable income and push you up the brackets.

But they work differently:

In a year where you have significant bracket space, you can do both — but capital gain harvesting at 0% costs nothing while Roth conversions cost 12%+. The typical optimal sequence:

  1. Harvest gains at 0% first (cheapest, no tax cost)
  2. Then fill remaining bracket space with Roth conversions (which reduce future RMDs)

The catch: gain harvesting increases MAGI, which can push you into IRMAA territory before you expect. Both transactions use MAGI, not just taxable income. See our IRMAA calculator before finalizing.

The IRMAA trap: The first IRMAA tier (2026) kicks in at $103,000 MAGI for single filers and $206,000 for MFJ. MAGI is calculated before the standard deduction. A couple with $62,000 in gross ordinary income ($30K pension + $32K gross SS) who harvests $145,000 in gains could inadvertently push MAGI to $207,000 — just over the first IRMAA tier — increasing Part B premiums by $1,980 per person, per year. Always run the IRMAA check before executing.

Gain harvesting vs. leaving gains for heirs: the step-up in basis tradeoff

Under current law, assets held in taxable accounts receive a stepped-up cost basis at death. If you die holding appreciated stock with $100,000 of unrealized gain, your heirs inherit it at today's market value — that $100,000 gain permanently disappears without anyone paying capital gains tax.

This creates a tradeoff:

For gains you're confident you'll hold until death, the step-up in basis argument is powerful — why realize gains now even at 0% when your heirs get the same elimination at death? The counterargument: you might need to sell before death (health care costs, market rebalancing), and the 0% window may not be available later. There is no universally correct answer; it depends on your estate plan, health, liquidity needs, and confidence in holding positions long-term.

If the estate is large enough to trigger estate tax concerns — the 2026 exemption is $15M per person ($30M married) under OBBBA,3 permanent — most retirees have no estate tax exposure, and the step-up in basis advantage is real.

State taxes: the calculator doesn't include them

Nine states have no income tax at all (Florida, Texas, Nevada, Washington, Wyoming, Alaska, South Dakota, Tennessee, New Hampshire). Several others exempt Social Security or retirement income but still tax capital gains. Before executing a large gain harvest, check your state's treatment of long-term capital gains — some states tax them identically to ordinary income (California at up to 13.3%), which can completely negate the federal tax savings.

For retirees in high-tax states with large unrealized gains, state-level gain harvesting math can look very different from federal-only analysis. This is another area where a specialist's modeling pays for itself quickly.

The Net Investment Income Tax (NIIT)

The 3.8% NIIT applies to net investment income — including long-term capital gains — when modified AGI exceeds $200,000 (single) or $250,000 (MFJ).4 These thresholds are not inflation-adjusted, so they bite more retirees each year. Gains below the NIIT threshold but above the IRMAA tier face 15% LTCG rate. Gains above the NIIT threshold face 18.8% (15% + 3.8%).

Most retirees doing modest gain harvesting stay well below the NIIT threshold. It becomes relevant for retirees with large portfolios, high pension income, or large lump-sum gains from property sales.

Sources

  1. IRS — Tax Inflation Adjustments for Tax Year 2026 (including OBBBA amendments). 2026 LTCG 0% thresholds: $49,450 single / $98,900 MFJ taxable income. Per Rev. Proc. 2025-32.
  2. IRS — Required Minimum Distributions (RMDs). SECURE 2.0 § 107: RMD age 73 for those born 1951–1959; age 75 for those born 1960 or later.
  3. IRS — Estate and Gift Tax. OBBBA (2025) permanently set the estate and gift tax exemption at $15M per person, indexed for inflation. $30M combined for married couples using portability.
  4. IRS Topic No. 559 — Net Investment Income Tax. 3.8% NIIT on net investment income for MAGI over $200,000 (single) / $250,000 (MFJ). Threshold not inflation-adjusted.

2026 LTCG thresholds verified against IRS Rev. Proc. 2025-32 and Tax Foundation data. NIIT thresholds unchanged since 2013. State tax treatment of capital gains varies widely — consult a local tax professional.

Talk to a retirement tax planning specialist

Gain harvesting sounds simple but interacts with IRMAA, Roth conversions, Social Security taxation, state taxes, estate planning, and RMD projections in ways that require multi-year modeling. A fee-only retirement specialist can calculate your exact 0% harvesting window each year and coordinate it with your full retirement income plan. Free match. No obligation.