← Back to calculator
Retirement Planning

Capital Gains Tax and Retirement Planning (2026)

During your working years, capital gains tax is mostly a nuisance you deal with when you sell something. In retirement it becomes a central planning variable. You control almost every dollar of income you report — which account you draw from, when you sell, how much gain you realize — and that control is exactly what makes the difference between paying 0% and paying 23.8% on the same portfolio.

The core insight is that retirement gives most people a window of unusually low taxable income, usually between the last paycheck and the first required minimum distribution. Inside that window, long-term gains can often be realized entirely tax-free. Outside it, the same gains can drag Social Security into taxation, raise Medicare premiums, and stack on top of RMDs at the worst possible rate. This guide walks through how each of those pieces interacts, with worked numbers you can reproduce in our capital gains tax calculator.

Where Capital Gains Tax Applies in Retirement (and Where It Doesn't)

Before optimizing anything, be clear about which accounts even generate capital gains. This is the single most common source of confusion among retirees.

Account typeTax on growthTax when you withdraw
Taxable brokerageDividends & realized gains taxed yearlyLong-term gains at 0%/15%/20% on the gain only
Traditional IRA / 401(k)Deferred, untaxed inside the accountOrdinary income on the full withdrawal — never capital gains rates
Roth IRA / Roth 401(k)Tax-freeTax-free if age 59½+ and the 5-year rule is met
HSATax-freeTax-free for qualified medical expenses; ordinary income otherwise
Inherited taxable assetsBasis stepped up at deathGain measured from the date-of-death value

Two consequences follow. First, a stock that tripled inside a traditional IRA gets no capital gains treatment at all — every dollar you pull out is ordinary income. Second, only your taxable brokerage account gives you the ability to choose how much income to recognize in a given year, because you decide when and which lots to sell. That flexibility is the raw material for every strategy below.

Basis matters more than balance. A $400,000 taxable account with a $380,000 cost basis is nearly as flexible as cash — selling it all generates only $20,000 of gain. A $400,000 account with a $90,000 basis carries $310,000 of embedded gain and needs to be unwound over years. Pull your broker's unrealized gain/loss report before building a withdrawal plan.

The 2026 Long-Term Capital Gains Brackets Retirees Should Memorize

Long-term gains (assets held more than one year) sit in their own rate schedule, driven by total taxable income — ordinary income first, then gains stacked on top. For 2026, per IRS Rev. Proc. 2025-32:

RateSingleMarried Filing JointlyHead of Household
0%Up to $49,450Up to $98,900Up to $66,200
15%$49,451 – $545,500$98,901 – $613,700$66,201 – $579,600
20%Over $545,500Over $613,700Over $579,600

Layered on top is the 3.8% Net Investment Income Tax, which applies once modified AGI exceeds $200,000 (single) or $250,000 (joint). Those thresholds have never been indexed for inflation, so more retirees with large one-time sales cross them each year. Short-term gains — rare but not unheard of for retirees rebalancing recent purchases — are taxed at ordinary rates; see our short-term capital gains guide.

Crucially, the bracket thresholds are measured against taxable income after deductions. A married couple both over 65 in 2026 takes a $30,000 standard deduction plus $1,600 each for age, and under current law a temporary additional senior deduction of up to $6,000 per person applies through 2028 (phasing out as income rises). That means gross income can exceed $130,000 while taxable income still lands inside the 0% capital gains bracket.

0% Bracket Planning: The Retiree's Best Tax Break

Gain harvesting is the deliberate act of selling appreciated positions specifically to fill unused 0% bracket space, then immediately buying the same investment back. Unlike loss harvesting, the wash-sale rule does not apply to gains — you can repurchase the identical security the same afternoon. The result is a permanently higher cost basis at zero federal tax cost.

The three-step calculation

  1. Project your ordinary taxable income for the year: pensions, annuity payments, taxable Social Security, interest, and any traditional IRA withdrawals, minus your standard or itemized deduction.
  2. Subtract that figure from the top of the 0% bracket ($49,450 single / $98,900 joint). The remainder is your harvest room.
  3. Sell high-basis-shortfall lots — the ones with the largest gain per dollar of proceeds — until you have realized that amount of long-term gain. Reinvest immediately.
Worked example 1 — early retiree, single filer. Diane is 62, retired, not yet claiming Social Security. She lives on $34,000 of taxable brokerage withdrawals, of which $6,000 is realized gain, plus $9,000 of interest and dividends. Her ordinary taxable income after the $15,000 single standard deduction (2026) is about $0, since her interest and dividends are largely absorbed by the deduction. That leaves roughly $49,000 of 0% harvest room. She sells enough of a long-held index fund to realize $43,000 of additional long-term gain and repurchases the same fund. Federal capital gains tax: $0. Her basis rises $43,000, which at a future 15% rate is $6,450 of tax permanently avoided.

Two cautions keep this from being free money. Realized gains raise AGI, which can reduce Affordable Care Act premium subsidies for retirees under 65 — often the binding constraint for people retiring at 60. And harvesting uses up bracket space that a Roth conversion could have used instead, which is the trade-off in the next section.

Roth Conversions vs Gain Harvesting: You Usually Can't Do Both

A Roth conversion moves money from a traditional IRA to a Roth IRA and reports the converted amount as ordinary income. Because ordinary income is stacked underneath capital gains, every dollar converted displaces a dollar of 0% capital gains room. The two strategies compete for the same scarce resource: the space between your income and the top of a low bracket.

SituationUsually favorsWhy
Large pre-tax IRA, modest taxable accountRoth conversionFuture RMDs would land in the 22–24% bracket or higher; converting at 10–12% is a clear arbitrage
Large low-basis taxable account, small IRAGain harvestingRMDs will be small; the real risk is a forced high-rate sale later
Heirs in high tax bracketsRoth conversionRoth assets pass tax-free; the 10-year inherited IRA rule makes pre-tax balances expensive to inherit
Heirs will inherit soonNeither — holdStepped-up basis at death eliminates the embedded gain entirely
Charitable intent after 70½Qualified charitable distributionsQCDs satisfy RMDs without adding income, preserving 0% gain space
Worked example 2 — the trade-off priced out. Frank and Rita, both 66, have $40,000 of taxable income after deductions and $58,900 of room below the joint 0% ceiling of $98,900. Option A: harvest $58,900 of long-term gains at 0%, saving $8,835 of future tax at 15%. Option B: convert $58,900 from a traditional IRA. It lands mostly in the 12% and 22% ordinary brackets, costing roughly $9,000 now, but removes about $59,000 from a pre-tax balance that would otherwise be distributed at 22% plus state tax later, and shelters all future growth. With a $1.6M pre-tax balance, Option B wins on lifetime tax because their RMDs at 75 will exceed $65,000 a year regardless. With a $250,000 pre-tax balance, Option A wins.

A practical compromise many retirees use: convert in the first few low-income years to defuse the pre-tax balance, then switch to gain harvesting once projected RMDs look manageable. Whichever you choose, decide before December and confirm the numbers — a conversion cannot be undone, since recharacterization of conversions was eliminated in 2018.

Required Minimum Distributions and the Shrinking 0% Window

RMDs begin at age 73 for most current retirees (age 75 for those born in 1960 or later, under SECURE 2.0). They are always ordinary income — never capital gains — and they are not optional, with a penalty of 25% of the shortfall, reduced to 10% if corrected promptly.

The planning problem is displacement. An RMD fills your low brackets from the bottom, so it pushes your capital gains upward into the 15% or 20% band. A retiree who could realize $60,000 of tax-free gains at 68 may have zero 0% room at 75.

AgePre-tax balanceIRS divisorRMDApprox. 0% gain room left (joint)
72$1,200,000$0~$65,000
73$1,240,00026.5$46,800~$18,000
78$1,300,00022.0$59,100$0
85$1,250,00016.0$78,100$0

Divisors come from the IRS Uniform Lifetime Table; balances are illustrative and assume modest growth net of withdrawals. The pattern is what matters: RMDs rise as a percentage of the account every year, so the window closes progressively rather than all at once.

Tip: If you must sell taxable assets in an RMD year, satisfy the RMD in cash from the IRA rather than selling low-basis stock, and consider taking the RMD as a qualified charitable distribution (up to $108,000 in 2025, indexed) if you give to charity. A QCD excludes the distribution from income entirely, which can reopen 0% capital gains room and lower the taxable share of your Social Security.

How Capital Gains Interact With Social Security: the Tax Torpedo

Social Security is taxed based on provisional income: AGI excluding benefits, plus tax-exempt interest, plus one-half of your benefits. Capital gains are fully counted in that figure — including gains taxed at 0%.

Provisional income (single)Provisional income (joint)Share of benefits taxable
Under $25,000Under $32,0000%
$25,000 – $34,000$32,000 – $44,000Up to 50%
Over $34,000Over $44,000Up to 85%

These thresholds were set in 1983 and 1993 and have never been indexed, which is why they now catch middle-income retirees routinely. The consequence for gain planning is counterintuitive: inside the phase-in range, realizing $1,000 of long-term gain can make an additional $850 of Social Security benefits taxable. That $850 is ordinary income, so a gain nominally taxed at 0% can still generate real tax.

Worked example 3 — the torpedo in numbers. Marcus and Elena receive $52,000 of Social Security and $22,000 from a small pension. Before any sales, provisional income is $22,000 + $26,000 = $48,000, making part of their benefits taxable. They sell a stock position for a $30,000 long-term gain. Provisional income rises to $78,000, increasing taxable Social Security by roughly $25,500 (85% of the gain, capped by the 85% ceiling). Their taxable income climbs by about $55,500 rather than $30,000. The gain itself may still fall in the 0% bracket, yet the extra ordinary income from benefits is taxed at 12% and 22% — an effective marginal rate on the gain of roughly 15–20% despite a 0% stated rate.

Practical responses: realize large gains before claiming Social Security if possible, spread gains across years to stay below the 85% ceiling, or push a large sale into a year when you already hit the 85% cap (once fully capped, additional gains no longer drag benefits into taxation). Muni bond interest does not help here — it is added back into provisional income.

Medicare IRMAA: the second surcharge

A one-time large gain also affects Medicare. Part B and D surcharges (IRMAA) are based on MAGI from two years earlier, and the first tier begins near $109,000 for single filers and $218,000 for joint filers in 2026. Crossing a tier by a single dollar raises premiums for the whole year, so a $500,000 home or business sale at 68 can add well over $1,000 per person in premiums at 70. IRMAA is a cliff, not a phase-in — worth modeling before you sell.

Timing and Sequencing Strategies for Retirees

1. Map the low-income window explicitly

Draw a timeline from your retirement date to your RMD start age. Each year in that window has a bracket capacity. Filling it deliberately — with conversions, harvested gains, or both — converts a temporary opportunity into permanent tax savings. Doing nothing leaves the capacity unused forever.

2. Delay Social Security to widen the window

Claiming at 70 instead of 62 raises the benefit permanently and keeps provisional income near zero during the intervening years, which is precisely when gain harvesting and conversions are cheapest. The tax benefit is a genuine secondary argument for delayed claiming, on top of the higher benefit itself.

3. Use specific lot identification

Instruct your broker to use specific lot rather than average cost or FIFO. Selling the highest-basis shares first minimizes gain when you need cash; selling the lowest-basis shares first maximizes basis reset when you are deliberately harvesting at 0%. The same trade can produce wildly different taxable amounts depending on lot selection.

4. Pair harvesting with loss harvesting

Realized losses offset realized gains dollar for dollar, and up to $3,000 of net loss reduces ordinary income each year with the remainder carrying forward indefinitely. A retiree with a $40,000 loss carryforward can effectively sell $40,000 of gains with no tax regardless of bracket. Track carryforwards on Schedule D year to year — they are frequently forgotten.

5. Give appreciated shares instead of cash

Donating long-held appreciated stock directly to a charity or donor-advised fund avoids the gain entirely and yields a deduction at fair market value, subject to AGI limits. For retirees who itemize, this is more efficient than selling and donating proceeds. After 70½, compare against a QCD, which helps even for non-itemizers.

6. Consider holding the most appreciated assets for life

Assets held at death receive a stepped-up basis, erasing the unrealized gain for heirs. If you have enough other resources, the lowest-basis positions are often the ones to keep — spend the high-basis holdings and the IRA instead. This interacts with estate planning, so coordinate with your advisor.

7. Watch state taxes and residency

Most states tax capital gains as ordinary income with no preferential rate, and a handful have no income tax at all. Retirees relocating in retirement should time large sales relative to the residency change carefully; states can assert taxing rights over gains with in-state source or over incomplete moves. Compare your options with our state capital gains tax rates.

Sequencing default that works for many retirees: spend taxable dividends and cash first → harvest long-term gains up to the 0% ceiling → fill remaining low-bracket room with traditional IRA withdrawals or Roth conversions → take RMDs when required (via QCD if charitable) → touch Roth last. Adjust for ACA subsidies before 65 and IRMAA tiers after 63.

Five Costly Mistakes Retirees Make

A Year-by-Year Planning Checklist

  1. January: estimate the year's ordinary income and identify bracket capacity.
  2. Spring: review lot-level unrealized gains and any loss carryforwards from last year's Schedule D.
  3. Mid-year: decide the conversion-versus-harvest split; execute in tranches rather than all at once.
  4. November: check fund distribution estimates, recompute provisional income, and verify you are not about to cross an IRMAA or NIIT threshold.
  5. December: complete conversions (hard deadline of December 31), harvest remaining 0% room, and take RMDs or QCDs.
  6. Ongoing: refresh projections after any large life event — a home sale, an inheritance, a spouse's death that changes filing status from joint to single.

That last point deserves emphasis. When one spouse dies, the survivor typically files jointly for that year and then as a single filer, cutting the 0% capital gains ceiling from $98,900 to $49,450 and the NIIT threshold from $250,000 to $200,000. Gains that were free become taxable at the same income level. Couples with large taxable accounts should consider accelerating some harvesting while both are alive, and should confirm how much basis step-up applies — 50% in most states, 100% in community property states.

Frequently Asked Questions

Do retirees pay capital gains tax on investments they sell?

Only on taxable brokerage holdings, and only on the gain above basis. Traditional IRA and 401(k) withdrawals are ordinary income no matter how the money grew, and qualified Roth withdrawals are tax-free. Many retirees pay 0% on long-term gains, since the 2026 0% bracket runs to $49,450 of taxable income for single filers and $98,900 for joint filers.

Should I do a Roth conversion or harvest capital gains at 0%?

Rarely both in the same year, because a conversion is ordinary income that consumes the same bracket space. Favor conversions when your pre-tax balance is large enough that future RMDs would land in a higher bracket, or when heirs would inherit pre-tax money. Favor harvesting when your taxable account holds most of the embedded gain and projected RMDs are modest.

Do capital gains make my Social Security benefits taxable?

Yes. Gains count in provisional income, so realizing a gain can make up to 85 cents of each additional benefit dollar taxable. This tax torpedo means a gain taxed at 0% can still raise your total bill, with effective marginal rates sometimes exceeding 20%. Realizing large gains before claiming benefits avoids the problem entirely.

Are required minimum distributions taxed as capital gains?

No — RMDs are always ordinary income. Their relevance to capital gains is indirect but significant: because ordinary income stacks beneath gains, RMDs consume your low brackets and push realized gains from 0% into 15% or 20%. Qualified charitable distributions are the main tool for satisfying an RMD without adding income.

What is the best withdrawal order to minimize capital gains tax?

A common default is taxable cash and dividends first, then long-term gains harvested up to the 0% ceiling, then traditional IRA withdrawals or Roth conversions to fill remaining low-bracket space, with Roth spent last. Highly appreciated positions are often held until death so heirs receive a stepped-up basis. Adjust for ACA subsidies before 65 and Medicare IRMAA tiers afterward.

Model your own numbers. Run your projected retirement income and planned sales through our free capital gains tax calculator to see exactly where your 0% bracket ends. Then compare related strategies in our guides on reducing capital gains tax, long-term gains, married filing jointly, and home sales.

Figures reflect IRS Rev. Proc. 2025-32 inflation adjustments for tax year 2026 and SECURE 2.0 distribution rules. Thresholds for Medicare IRMAA and senior deductions are subject to annual updates and legislative change. This guide is educational and not individualized tax advice; consult a CPA or CFP before executing conversions or large sales.

CC
CapitalCalc Editorial Team

Our editorial team combines expertise in tax law, financial planning, and software engineering. All content is fact-checked against primary IRS sources (Revenue Procedures, Publications, and Instructions) and reviewed by professionals with backgrounds in public accounting and fintech. We update our guides annually to reflect the latest tax code changes.

About Us → Editorial Policy →