Capital Gains in Retirement: How to Pay 0% on Your Investment Profits
Patricia sold $40,000 worth of Apple stock last February. She'd bought the shares twenty years ago for $8,000, and now she needed the money to help her daughter with a house down payment.
She expected to pay about $4,800 in federal taxes on the $32,000 gain — that's the 15% long-term capital gains rate she'd always heard about.
When her accountant finished her return, Patricia owed nothing. Zero federal tax on a $32,000 profit.
"I thought you made a mistake," Patricia told him. "Nobody pays 0% on capital gains."
But he hadn't made a mistake. Patricia simply didn't know about a tax bracket that could have saved her thousands in previous years — a bracket that many retirees qualify for but rarely use.
The bracket nobody tells you about
Most people know that long-term capital gains — profits on investments held longer than a year — get preferential tax treatment. Instead of ordinary income rates that can reach 37%, gains are taxed at either 0%, 15%, or 20%.
What most people don't realize is that the 0% rate isn't a rare exception. It applies to anyone whose taxable income falls below certain thresholds, and in retirement, that's a surprisingly large number of people.
For 2024, the 0% bracket covers taxable income up to $47,025 for single filers and $94,050 for married couples filing jointly. Those numbers include your capital gains — meaning if your total taxable income (ordinary income plus gains) stays below these thresholds, you pay nothing on your investment profits.
Think about what that means. A retired couple with $30,000 in Social Security (taxable portion), $20,000 from a pension, and $15,000 in interest and dividends has $65,000 in taxable income after the standard deduction. They have nearly $30,000 of "room" in the 0% bracket — space they could fill by selling appreciated investments and paying zero federal tax on the gains.
Patricia's situation was similar. Her only income came from Social Security and a small pension. After deductions, her taxable income was about $28,000 — well below the $47,025 threshold. Her $32,000 gain kept her total at $60,000, still within the 0% zone.
Why short-term gains cost you more
Not all investment profits are created equal. The IRS draws a sharp line between short-term and long-term holdings, and the difference can cost you thousands.
If you sell an investment you've held for less than one year, any profit gets taxed as ordinary income. That means it goes into the same bucket as your wages, pension, and IRA withdrawals — potentially at rates from 10% to 37%. There's no 0% bracket, no preferential treatment, just regular income tax.
Hold that same investment for at least one year and one day, and everything changes. The profit becomes a long-term capital gain, eligible for the 0%, 15%, or 20% rates depending on your income.
Picture this scenario: Margaret has two stocks she wants to sell. Both have $20,000 in gains. Stock A she bought eleven months ago. Stock B she bought thirteen months ago. If she sells both today, Stock A's profit gets taxed at her 22% ordinary rate — that's $4,400 in federal taxes. Stock B's profit, as a long-term gain, might cost her nothing if she has room in the 0% bracket.
The lesson is simple: whenever possible, wait for the one-year mark. That patience can be worth thousands of dollars.
How gain harvesting works
"Harvesting gains" sounds counterintuitive. In investing, we usually talk about harvesting losses to offset taxes. But for retirees with room in the 0% bracket, harvesting gains can be even more valuable.
The strategy works like this: You identify appreciated investments in your taxable brokerage account. You sell them, realizing the gain, and if your total taxable income stays below the 0% threshold, you pay no federal tax on the profit. Then you immediately repurchase the same investments — there's no "wash sale" rule for gains, unlike for losses.
What have you accomplished? You've reset your cost basis to the current price. Any future appreciation starts fresh. If you eventually sell those shares in a year when you're above the 0% bracket, you'll only pay taxes on the new gains — not on the appreciation you already "harvested" tax-free.
Consider Bob and Carol, a married couple both age 70. They have $20,000 in taxable Social Security, a $25,000 pension, and $15,000 from an IRA withdrawal. Their standard deduction of $32,200 (including the over-65 bonus) brings their taxable income to about $28,000.
They have room in the 0% bracket up to $94,050 — that's roughly $66,000 of space. They could sell stock with $60,000 in gains, pay zero federal tax, and immediately repurchase. That $60,000 of appreciation? It will never be taxed. They've permanently eliminated the tax on those gains.
TIP
Review your bracket space every December. Unused room in the 0% bracket doesn't carry forward — it's a "use it or lose it" opportunity.
When the market drops: harvesting losses
The opposite strategy applies when investments decline. Tax-loss harvesting lets you turn paper losses into real tax savings.
When you sell an investment for less than you paid, you create a capital loss. These losses first offset any capital gains dollar-for-dollar. If your losses exceed your gains, you can use up to $3,000 per year to offset ordinary income — your pension, IRA withdrawals, or other taxable income. Any excess losses carry forward indefinitely, waiting to offset future gains.
Sarah has $10,000 in losses from a tech stock that tanked and $8,000 in gains from selling a real estate fund. She harvests the losses by selling the underwater position. The $10,000 loss offsets her $8,000 gain entirely, leaving $2,000 in excess losses. That $2,000 reduces her ordinary income, saving her about $440 at a 22% rate. The remaining $0 carries forward to next year.
There's one catch: the wash sale rule. If you buy "substantially identical" securities within 30 days before or after selling at a loss, the IRS disallows the loss deduction. You can work around this by purchasing a similar but not identical investment immediately — say, a different index fund tracking a similar market — or by waiting 31 days to repurchase the exact same investment.
The hidden surtax on high earners
Above certain income levels, an additional 3.8% tax applies to investment income. This Net Investment Income Tax (NIIT) kicks in when your modified adjusted gross income exceeds $200,000 for single filers or $250,000 for married couples filing jointly.
The surtax applies to capital gains, dividends, interest, rental income, and passive business income. It doesn't apply to wages, self-employment income, or distributions from retirement accounts.
What this means practically: if you're above the NIIT thresholds, your capital gains rate isn't just 15% — it's 18.8%. And if you're in the highest bracket (above $583,750 for married couples), you're paying 20% plus 3.8% for a combined 23.8% rate on long-term gains.
This is another reason to manage your income strategically in retirement. Keeping MAGI below $250,000 doesn't just affect Medicare IRMAA — it also keeps you out of NIIT territory.
Where you hold investments matters
Asset location — placing different investments in different account types — can significantly reduce your lifetime tax burden.
The principle is straightforward: put tax-inefficient investments in tax-advantaged accounts, and keep tax-efficient investments in taxable accounts.
Bonds and REITs generate ordinary income — interest that's taxed at your regular rate. These belong in your Traditional IRA or 401(k), where you won't pay taxes on the income until you withdraw.
Growth stocks and index funds are tax-efficient. They generate minimal dividends, and gains are only taxed when you sell. Keep these in taxable accounts where you can access the 0% long-term gains bracket and use tax-loss harvesting.
Roth accounts are ideal for investments with the highest expected growth. Everything that happens in a Roth — dividends, gains, appreciation — is never taxed. Put your most aggressive growth investments there.
Municipal bonds are already tax-exempt at the federal level (and often at state level too). There's no benefit to sheltering them further — keep them in taxable accounts.
The impact compounds over time. Consider $100,000 in bonds earning 5% ($5,000 annually). In a taxable account at a 22% rate, that's $1,100 in taxes every year. In a Traditional IRA, you pay nothing until withdrawal. In a Roth, you pay nothing ever. Over 20 years, proper asset location on just this one investment could save you $22,000 or more.
The step-up in basis: a gift to your heirs
One of the most powerful tax provisions in the code applies when you die — and it affects how you should think about appreciated assets during your lifetime.
When you pass away, your heirs receive your investments at their current market value, not at your original purchase price. This "stepped-up basis" eliminates all unrealized gains accumulated during your lifetime.
Picture this: You bought Amazon stock for $10,000 twenty years ago. When you die, it's worth $100,000. Your heir's cost basis isn't $10,000 — it's $100,000. If they sell immediately, they owe nothing in capital gains tax. The $90,000 of appreciation? Gone from the tax rolls entirely.
This has practical implications for your strategy. Highly appreciated assets that you don't need to sell might be better held until death rather than sold and replaced. The step-up in basis provides an automatic, complete tax elimination that no other strategy can match.
But balance this against concentration risk. Holding $500,000 in a single appreciated stock for the step-up benefit isn't wise if that concentration exposes you to significant downside. Sometimes paying 15% in capital gains tax to diversify is the right move for your overall financial security.
NOTE
The step-up in basis only applies at death. If you gift appreciated assets during your lifetime, the recipient inherits your cost basis — and your unrealized gain.
When capital gains affect Social Security and Medicare
Realized capital gains count toward your adjusted gross income, which affects two important calculations: how much of your Social Security gets taxed, and whether you pay Medicare IRMAA surcharges.
Social Security taxation uses "combined income" — your AGI plus nontaxable interest plus 50% of your Social Security benefits. If combined income exceeds $32,000 for singles or $44,000 for married couples, up to 85% of benefits become taxable. A large capital gain can push more of your Social Security into the taxable zone, creating a "tax torpedo" effect where each dollar of gain makes nearly $2 of income taxable.
Medicare IRMAA works on a two-year lookback. Your 2024 income determines your 2026 Medicare premiums. A $100,000 capital gain in 2024 could push you into a higher IRMAA tier, adding thousands to your Medicare costs two years later.
The strategy here is timing and spreading. If you need to realize a large gain, consider whether you're already in the Social Security taxation zone (where an additional gain might not matter much) versus in the phase-in range (where it creates the torpedo effect). Think about IRMAA thresholds and whether you can spread the sale across multiple years to stay below the cliff.
Making it practical
Capital gains tax planning in retirement comes down to a few key principles.
First, know your bracket space. Every year, calculate how much room you have in the 0% long-term gains bracket. That space represents a gift from the tax code — free money if you use it, wasted opportunity if you don't.
Second, hold investments for at least a year before selling. The difference between short-term and long-term treatment is dramatic, and patience costs nothing.
Third, harvest strategically — gains when you're in the 0% bracket, losses when you have gains to offset or ordinary income to reduce. Both moves reduce your lifetime tax burden.
Fourth, think about where investments live. Tax-inefficient investments in tax-advantaged accounts, tax-efficient investments in taxable accounts, highest-growth potential in Roth accounts.
Finally, consider the bigger picture. Capital gains don't exist in isolation — they interact with Social Security taxation, Medicare IRMAA, and your overall income strategy. A gain harvesting opportunity that triggers IRMAA surcharges might not be worth it. A loss that frees up income for a Roth conversion might be more valuable than its face value.
The goal isn't to never pay capital gains taxes — it's to pay them at the lowest possible rate, at the time of your choosing, in the way that minimizes your overall tax burden across retirement.
Need help optimizing capital gains in your retirement portfolio? Connect with a retirement advisor who can create a tax-efficient investment strategy tailored to your situation.