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 status | 0% rate up to | 15% rate up to | 20% 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.
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
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:
- $24,000/year in Social Security (combined), of which $20,400 is taxable (85% tier)
- $42,000/year pension income
- No other ordinary income sources (not yet taking IRA withdrawals)
- Standard deduction: $32,200 (MFJ 2026)
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:
- Roth conversions reduce future RMDs and produce tax-free growth. They're taxed at ordinary income rates (12–22% for most retirees in the conversion-window). See our Roth conversion guide for the full math.
- Gain harvesting resets basis on assets already in taxable accounts. Gains consumed at 0% rates — far cheaper than paying 12–22% on a Roth conversion.
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:
- Harvest gains at 0% first (cheapest, no tax cost)
- 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.
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:
- Harvest now at 0%: Eliminate the gain today; your heirs receive assets with a higher basis (equal to today's market value). Same end result — gain eliminated — but you do it during your lifetime.
- Leave for heirs: The gain is eliminated at death via step-up. But you retain the original lower basis and any future appreciation above today's price could still be subject to tax if sold before death.
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
- 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.
- 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.
- 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.
- 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.
Related tools and guides
- Medicare IRMAA Calculator 2026 — check how gain harvesting affects your Medicare premiums before you execute
- Roth Conversions in Retirement — how to coordinate Roth conversions and gain harvesting in the same year
- RMD Calculator with Tax Projection — see how RMDs will consume your 0% bracket space at 73+
- Tax-Efficient Withdrawal Order — which accounts to draw from first to preserve low-rate windows
- Social Security Tax Calculator — find out how much of your SS income is taxable, which affects bracket space
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.