Capital Gains Tax in Retirement: How to Maximize Your 0% Bracket
Use this guide to understand the assumptions, inputs, results, and next steps behind the calculator.
Selling investments from a taxable brokerage account is a common way to fund retirement, but it can trigger a significant tax bill. For retirees, managing capital gains tax is a delicate balancing act. The goal is to access your money without pushing yourself into a higher tax bracket or triggering other stealth taxes. Unlike your working years, your income in retirement can be lumpy, making it the perfect time to strategically realize gains.
This calculator helps you estimate the federal and state tax on an investment sale, but its real power is showing you how much room you have in the 2026 0% long-term capital gains bracket—which for married couples extends up to $96,700 of taxable income. By understanding these thresholds, you can plan sales to minimize or even eliminate your tax liability, a key part of any tax-efficient retirement withdrawal strategy.
2026 Long-Term Capital Gains Tax Brackets for Retirees
For assets held longer than one year, long-term capital gains are taxed at preferential rates of 0%, 15%, or 20%. These rates are determined by your total taxable income, which includes not just the capital gain itself but also income from pensions, part-time work, and the taxable portion of your Social Security benefits.
Your capital gains are "stacked" on top of your ordinary income to determine which bracket they fall into.
| Filing Status | 0% Rate Taxable Income | 15% Rate Taxable Income | 20% Rate Taxable Income |
|---|---|---|---|
| Single | Up to $48,350 | $48,351 – $533,400 | Over $533,400 |
| Married Filing Jointly | Up to $96,700 | $96,701 – $600,050 | Over $600,050 |
| Head of Household | Up to $64,750 | $64,751 – $566,700 | Over $566,700 |
Key Considerations:
- Short-Term Gains: Assets held for one year or less are taxed as ordinary income, at rates up to 37%, so it's almost always better for retirees to hold assets for over a year before selling.
- Net Investment Income Tax (NIIT): A 3.8% surtax applies to the lesser of your net investment income or the amount your Modified Adjusted Gross Income (MAGI) exceeds certain thresholds ($200,000 for Single, $250,000 for Married Filing Jointly). This tax is in addition to the capital gains tax.
- State Taxes: Many states also tax capital gains as regular income. This calculator helps you factor in state taxes, which can significantly impact your net proceeds.
Strategic Gain Harvesting: Filling Your Low-Tax Brackets
One of the most powerful tax strategies in retirement is "tax-gain harvesting." This involves intentionally selling appreciated assets to realize long-term capital gains up to the top of the 0% or 15% tax bracket. This is especially valuable in low-income years, such as the period after you stop working but before you start taking Required Minimum Distributions (RMDs) or Social Security.
Here’s how it works:
- Calculate Your Ordinary Income: Add up your expected income from pensions, part-time work, interest, and the taxable portion of Social Security.
- Determine Your Bracket Room: Subtract your ordinary taxable income from the top of the 0% capital gains bracket ($96,700 for MFJ in 2026). The result is how much you can realize in long-term gains without paying any federal tax.
- Realize Gains: Sell enough of your appreciated assets to generate a gain that "fills up" that room.
- Reinvest (Optional): You can immediately buy back the same security if you wish. Unlike tax-loss harvesting, there is no "wash sale" rule for gains. This action resets your cost basis to the new, higher value, reducing the future capital gain when you sell it again years later.
This strategy is a core component of a flexible retirement withdrawal strategy. By realizing gains in low-income years, you reduce the concentration of highly appreciated shares in your portfolio. This prevents a future scenario where a single large sale (e.g., for a new car or a home repair) pushes you into the 20% bracket and triggers the NIIT. It smooths out your tax liability over your lifetime, potentially saving you tens of thousands of dollars. A tax-efficient retirement withdrawal calculator can help model the long-term impact.
Scenario: Planning a $50,000 Stock Sale in Retirement
Let's consider a married couple, both age 68. In 2026, their retirement income consists of:
- $40,000 from the husband's pension.
- $35,000 in total Social Security benefits.
- They plan to take the standard deduction of $30,000, plus the additional amount for being over 65 ($1,550 x 2 = $3,100), for a total deduction of $33,100.
They want to sell a stock they bought years ago. The sale proceeds would be $50,000, and their cost basis is $10,000, resulting in a $40,000 long-term capital gain.
Analysis without the Gain:
- Provisional Income: $40,000 (pension) + 50% of $35,000 (SS) = $57,500.
- Taxable Social Security: Since $57,500 is above the $44,000 threshold, 85% of their benefits are taxable: 0.85 * $35,000 = $29,750.
- Taxable Income: $40,000 (pension) + $29,750 (taxable SS) - $33,100 (deduction) = $36,650.
This taxable income of $36,650 is well within the 0% LTCG bracket, which goes up to $96,700 for MFJ.
Analysis with the $40,000 Gain:
- New AGI: $40,000 (pension) + $29,750 (taxable SS) + $40,000 (gain) = $109,750.
- Total Taxable Income: $109,750 - $33,100 (deduction) = $76,650.
- Capital Gains Tax: The entire taxable income of $76,650 is below the $96,700 threshold for the 0% LTCG bracket.
Result: The couple can realize the entire $40,000 long-term capital gain and pay $0 in federal capital gains tax. They have successfully used their 0% bracket room. This is a far better outcome than if they waited until RMDs from a large 401(k) pushed their ordinary income much higher.
The Math Behind Your Capital Gains Tax Bill
The calculator determines your tax liability by layering your capital gain on top of your other income sources. Here are the core formulas it applies.
First, it calculates your actual capital gain:
Capital Gain = Sale Proceeds - Cost Basis
Next, it determines your taxable ordinary income, which sets the foundation for where your capital gains will be taxed. This includes the complex calculation for taxable Social Security.
Taxable Ordinary Income = (Ordinary Income + Taxable Social Security) - Standard or Itemized Deduction
Where:
- Sale Proceeds = The total amount you receive from selling the investment.
- Cost Basis = Your original purchase price, including reinvested dividends.
- Ordinary Income = Income from pensions, work, interest, RMDs, etc.
- Taxable Social Security = The portion of your benefits subject to tax, based on your provisional income.
- Deduction = Your standard or itemized deduction for the year.
The main calculation then determines the federal tax by allocating the gain across the long-term capital gains brackets.
Federal Capital Gains Tax = (Gain in 0% Bracket * 0.00) + (Gain in 15% Bracket * 0.15) + (Gain in 20% Bracket * 0.20)
Where:
- Gain in 0% Bracket = The portion of your capital gain that fits under the 0% bracket ceiling after accounting for your ordinary taxable income.
- Gain in 15% Bracket = The portion of your gain that falls into the 15% bracket.
- Gain in 20% Bracket = The portion of your gain that falls into the 20% bracket.
Finally, the Net Investment Income Tax (NIIT) is calculated if your income exceeds the threshold.
NIIT = 3.8% * Lesser of (Net Investment Income) or (MAGI - NIIT Threshold)
Where:
- Net Investment Income = Includes capital gains, dividends, interest, etc.
- MAGI = Modified Adjusted Gross Income.
- NIIT Threshold = $200,000 for Single filers, $250,000 for Married Filing Jointly.
Answers to Your Capital Gains Questions in Retirement
How are qualified dividends taxed in retirement?
Qualified dividends are taxed at the same preferential 0%, 15%, and 20% rates as long-term capital gains. They also use up room in those brackets, so a year with high dividend income leaves less space for realizing capital gains at the 0% rate. This calculator allows you to input qualified dividends for a more accurate estimate.
Can I use capital losses to offset gains?
Yes. This is called tax-loss harvesting. You can offset capital gains with capital losses from other investments. If your losses exceed your gains, you can deduct up to $3,000 of the excess against your ordinary income per year. Any remaining losses can be carried forward to future years.
Is my primary home sale subject to capital gains tax?
For most retirees, no. If you've owned and lived in your home for at least two of the five years before the sale, you can exclude up to $250,000 of gain if you're a single filer, or up to $500,000 if you're married filing jointly.
What is a "step-up in basis"?
When you inherit an asset, like stock or real estate, its cost basis is "stepped up" to its fair market value on the date of the original owner's death. This means your heir could sell the asset immediately and owe little to no capital gains tax. This is a powerful estate planning tool, though it is subject to changes in tax law like the potential sunset of the current estate tax exemption.
How do Roth conversions affect my capital gains tax?
A Roth conversion creates ordinary income, which fills up your standard deduction and lower tax brackets first. This directly reduces the amount of room available in the 0% and 15% capital gains brackets. It's crucial to coordinate Roth conversions and capital gain harvesting in the same year to avoid an unexpected tax bill.
Does selling investments in an IRA or 401(k) create a capital gain?
No. Capital gains taxes only apply to non-retirement (taxable) brokerage accounts. All withdrawals from a traditional IRA or 401(k) are taxed as ordinary income, regardless of the gains inside the account. Qualified withdrawals from a Roth IRA are completely tax-free.
What's the difference between marginal and effective tax rate on a gain?
Your marginal rate is the tax rate paid on the last dollar of your capital gain (e.g., 15% or 20%). Your effective tax rate is the total tax paid divided by the total gain. The effective rate is often lower because some of your gain may have been taxed at 0% before the rest was taxed at 15%.
Plan Your Next Move
Understanding your capital gains exposure is a critical piece of retirement income planning. Use this calculator to model different sale amounts and see how timing can impact your total tax bill.
For a broader view, see how this fits into your overall withdrawal plan with the Retirement Withdrawal Calculator or explore different sequences with the Retirement Withdrawal Strategy Calculator. To understand the long-term impact on your portfolio, use the How Long Will My Money Last Calculator.