Selling an investment for a $20,000, $40,000, or even larger profit does not automatically mean handing part of that gain to the IRS. Some retirees can legally realize long-term investment gains while paying a 0% federal capital gains tax rate.
The opportunity usually appears when taxable income is relatively low. Retirement can create those years because wages may disappear, Roth withdrawals may be tax free, deductions may reduce taxable income, and retirees often have more control over when investments are sold.
There is one catch. The calculation involves more than looking at the size of the gain. IRA withdrawals, pensions, qualified dividends, taxable Social Security, and other income can fill the same tax space and turn part of a seemingly tax-free gain into a taxable one.
The 2026 Rule That Can Make Long-Term Gains Tax Free

The federal government has three main rates for most long-term capital gains: 0%, 15%, and 20%. Which rate applies depends largely on taxable income and filing status.
For tax year 2026, the IRS sets the top of the 0% long-term capital gains range at $49,450 for most single taxpayers and $98,900 for married couples filing jointly.
2026 Federal 0% Capital Gains Thresholds
| Filing status | Top of 0% range |
|---|---|
| Single | $49,450 |
| Married filing jointly | $98,900 |
| Head of household | $66,200 |
| Married filing separately | $49,450 |
These numbers apply to taxable income, not simply salary, pension income, Social Security checks, or the amount withdrawn from a bank account. That difference is one reason the rule can be especially useful after retirement.
The special rate generally applies to net long-term capital gains, meaning qualifying assets held longer than one year. Short-term capital gains are generally taxed using ordinary income tax rates instead.
That distinction matters. Selling stock after 11 months and selling the same stock after more than one year can produce very different federal tax treatment.
How to Calculate Your Remaining 0% Capital Gains Room

Think of taxable income as filling a container. Your ordinary taxable income generally fills the lower part first, while qualified dividends and long-term capital gains sit on top and receive their special rates.
Suppose a single retiree has $30,000 of taxable ordinary income after applicable deductions. With the 2026 0% threshold at $49,450, there is roughly $19,450 of remaining space before long-term gains begin moving into the 15% range.
If that retiree realizes $15,000 of qualifying long-term gain and has no qualified dividends or other complications, total taxable income becomes $45,000. The entire $15,000 gain remains inside the 0% federal range.
Here are a few simplified examples.
What Different Income Levels Can Mean
| Filing situation | Taxable ordinary income | Long-term gain | Approx. gain at 0% |
|---|---|---|---|
| Single | $30,000 | $15,000 | $15,000 |
| Single | $40,000 | $20,000 | $9,450 |
| Married filing jointly | $55,000 | $40,000 | $40,000 |
| Married filing jointly | $80,000 | $30,000 | $18,900 |
These examples assume no qualified dividends and no unusual capital gain categories. They are meant to show how the bracket works rather than calculate anyone’s final tax bill.
In the second example, the single retiree has $40,000 of taxable ordinary income. Only $9,450 remains under the $49,450 threshold, so that part of the $20,000 gain can fall into the 0% range. The rest generally moves into the next applicable capital gains bracket.
Qualified dividends also use this preferential tax structure. A retiree with substantial qualified dividends therefore has less 0% space available for investment sales than someone with the same ordinary income but no qualified dividends.
The IRS Qualified Dividends and Capital Gain Tax Worksheet handles this calculation.
Why Retirees May Have More Room Than They Expect

Taxable income can be much lower than the amount of cash flowing through a household during the year. Deductions and the tax treatment of different retirement accounts help explain why.
For 2026, the basic standard deduction is $16,100 for single taxpayers and $32,200 for married couples filing jointly. The basic deduction is $24,150 for heads of household.
People age 65 or older can also qualify for the existing additional standard deduction. For 2026, it is $2,050 for an unmarried taxpayer and $1,650 per qualifying married taxpayer, with specific filing rules.
There is also a separate enhanced senior deduction available for tax years 2025 through 2028. Eligible taxpayers age 65 or older may claim up to $6,000 each, or up to $12,000 when both spouses on a joint return qualify. That deduction begins phasing out above $75,000 of modified adjusted gross income for individual filers and $150,000 for joint filers.
That does not mean every retired couple can automatically subtract all these amounts and sell investments tax free. The enhanced deduction has eligibility and income rules, and investment gains themselves can affect income used in those calculations.
The useful lesson is simpler: work from an estimated tax return, rather than gross retirement income. The number that matters for the capital gains bracket is taxable income after the tax rules have been applied.
What Uses Up Your 0% Capital Gains Room?
Retirement income does not all behave the same way. Some income can consume the 0% capital gains space quickly, while other money may have little or no direct effect on taxable income.
| Income or transaction | Typical federal treatment | Can affect 0% gain room? |
|---|---|---|
| Pension income | Usually ordinary taxable income | Yes |
| Traditional IRA withdrawal | Generally ordinary taxable income | Yes |
| Long-term capital gain | Preferential capital gain rates | Yes |
| Qualified dividends | Preferential rates | Yes |
| Taxable Social Security | Included in taxable income | Yes |
| Qualified Roth IRA distribution | Generally tax free | Usually no |
| Return of investment principal | Generally not a gain | Depends on transaction |
| Eligible home-sale gain exclusion | Excluded from income | Generally no for excluded portion |
Traditional IRA withdrawals deserve special attention. The IRS generally taxes distributions from traditional IRAs as ordinary income, except for portions representing after-tax basis or another specific exclusion.
Qualified Roth IRA distributions work differently. When the IRS requirements for a qualified distribution are met, the distribution is generally excluded from gross income.
This can make the source of retirement spending important. Taking an additional $25,000 from a traditional IRA before realizing stock gains may reduce or eliminate the 0% capital gains window. Using qualified Roth money for some spending may produce a different federal tax result.
That does not mean Roth withdrawals should automatically replace traditional IRA withdrawals. Future required distributions, future tax rates, heirs, charitable plans, and account balances all matter. The capital gains bracket is one part of a larger retirement tax picture.
Tax-Gain Harvesting Can Reset Your Cost Basis at a Low Tax Rate

Some retirees intentionally realize gains during years when their income is unusually low. The strategy is often called tax-gain harvesting.
Suppose an investment was purchased for $20,000 and is now worth $35,000. Selling it creates a $15,000 long-term gain. If that gain fits completely inside the retiree’s federal 0% bracket, the federal capital gains tax on the transaction may be $0.
If the investor still wants to own the investment, selling and buying it again can establish a new cost basis based on the new purchase. Future appreciation would then begin from that higher basis.
This should not be confused with tax-loss harvesting. The IRS wash-sale rule can disallow a loss when substantially identical securities are repurchased within the specified 30-day window. The IRS describes that restriction specifically in connection with securities sold at a loss.
Tax-gain harvesting works best when there is a genuine low-income window. A common example is the period after work income stops but before large traditional retirement-account distributions begin.
The mistake is harvesting every dollar available just because the federal capital gains rate appears to be 0%. A larger gain can affect Social Security taxation, Medicare calculations, deductions, state income tax, and other parts of the return.
Use Capital Losses Before Paying Tax on Gains

Before selling an appreciated position, check whether the portfolio already contains investments with unrealized losses or whether unused capital loss carryovers remain from previous tax returns.
Capital losses generally offset capital gains. If total capital losses exceed capital gains, individuals can usually deduct up to $3,000 of the remaining net capital loss against other income, or $1,500 for married taxpayers filing separately. Unused losses can generally carry forward to later years.
For example, assume a retiree realizes a $30,000 gain on one investment and a $10,000 loss on another. The loss can reduce the net capital gain involved in the federal calculation.
A retiree carrying losses from a bad market year may therefore have more flexibility than expected. Before selling anything, review the prior year’s Schedule D and any capital loss carryover worksheet.
Loss harvesting has its own rules. Repurchasing substantially identical securities too quickly can trigger the wash-sale rule and postpone recognition of the loss, so gain harvesting and loss harvesting should not be treated as identical strategies.
A Home Sale Has a Separate Tax Break That Can Be Much Larger

Investment gains are only part of the story. Retirees downsizing or moving may also qualify for one of the largest capital gain exclusions available to households.
The IRS allows qualifying homeowners to exclude up to $250,000 of gain from the sale of a main home, or up to $500,000 for many married couples filing jointly. In general, the homeowner must satisfy ownership and residence requirements involving at least two years during the five-year period before the sale.
Notice that the exclusion applies to the gain, not the home’s selling price. Someone who sells a home for $650,000 does not automatically have a $650,000 capital gain.
Your gain starts with the selling price and is adjusted for your tax basis, qualifying improvements, certain selling expenses, and other items covered by IRS rules. Publication 523 contains worksheets for figuring the adjusted basis and taxable gain.
The rules become more complicated if the property was rented, used for business, acquired through certain exchanges, or had periods of nonqualified use. Depreciation related to business or rental use can also receive different treatment.
A surviving spouse may have additional rules worth checking. Under certain conditions, a surviving spouse who sells within two years of the spouse’s death may still qualify for an exclusion as high as $500,000.
IRA Withdrawals Can Quietly Shrink the 0% Window

One of the easiest ways to accidentally lose the 0% capital gains opportunity is taking a large traditional IRA distribution in the same calendar year as an investment sale.
Traditional IRA distributions are generally ordinary taxable income when they represent deductible contributions and earnings. Roth IRA qualified distributions, by contrast, generally are not included in gross income.
Suppose a married retired couple has $55,000 of taxable ordinary income and plans to realize $35,000 of long-term gains. Their combined taxable income would remain below the 2026 joint 0% capital gains ceiling of $98,900 in this simplified example.
Now suppose they take another $25,000 taxable traditional IRA withdrawal during December. That additional ordinary income can consume most of the remaining 0% capital gains space.
This is why investment sales should be coordinated with IRA withdrawals, Roth conversions, pensions, part-time income, and year-end distributions rather than decided in isolation.
For retirees who must eventually take required minimum distributions, timing can become especially important. IRS guidance says traditional IRA owners generally begin RMDs based on the applicable required beginning date, with age 73 applying to many current retirees.
Low-income years before larger mandatory withdrawals begin may therefore deserve special attention.
Social Security Can Make the Math More Complicated

A capital gain taxed at 0% can still increase another part of your tax return. Social Security is one of the most important examples.
To determine whether Social Security benefits are taxable, the IRS looks at a calculation that includes one-half of Social Security benefits plus other income, including investment income. The base amount is $25,000 for most single filers and $32,000 for married couples filing jointly.
As income rises, part of the Social Security benefit can become taxable. Depending on the taxpayer’s situation, as much as 85% of Social Security benefits may be included in taxable income.
That means realizing an additional $10,000 of investment gains can have two effects. The gain itself may qualify for the 0% long-term capital gains rate, while the added income causes more Social Security benefits to become taxable.
So “$0 capital gains tax” does not always mean “$0 additional federal tax.”
Medicare Premiums Are Another Number to Watch

Capital gains can also increase modified adjusted gross income used for Medicare’s income-related monthly adjustment amounts, commonly called IRMAA.
For 2026 Medicare Part B premiums, the first higher-income tier begins above $109,000 for individual filers and above $218,000 for married couples filing jointly. The standard 2026 Part B premium is $202.90 per month, while higher-income beneficiaries pay additional amounts.
The Medicare income test is separate from the 0% capital gains bracket. A transaction can receive favorable capital gains treatment while still increasing adjusted gross income used elsewhere.
Retirees close to a Medicare income threshold should therefore check the broader effect before realizing a very large gain. This matters especially when combining capital gains with Roth conversions, business income, pensions, or large retirement distributions.
The $0 Federal Rate Does Not Mean Every Type of Gain Is Tax Free

Most long-term gains on stocks, ETFs, mutual funds, and similar capital assets can qualify for the standard 0%, 15%, or 20% structure. Some gains follow different rules.
The IRS notes that collectibles can face a maximum 28% rate. Certain qualified small-business-stock gains can also fall under special rules, while part of the gain associated with depreciation on real property may be treated as unrecaptured Section 1250 gain with a maximum 25% rate.
High-income taxpayers may also face the 3.8% Net Investment Income Tax. The statutory MAGI thresholds are $200,000 for single or head-of-household filers and $250,000 for married couples filing jointly.
Then there are state taxes. The 0% bracket discussed in this article is a federal long-term capital gains rate. State treatment varies, so a transaction with no federal capital gains tax can still produce a state tax bill.
Hidden Costs to Check Before Selling
| Issue | Why it matters |
|---|---|
| Social Security | Extra income can make more benefits taxable |
| Medicare IRMAA | Higher MAGI can affect future Medicare premiums |
| State income tax | A federal 0% rate does not guarantee a state 0% rate |
| Qualified dividends | They share preferential-rate tax space |
| Traditional IRA withdrawals | They can increase ordinary taxable income |
| Collectibles | Special capital gain rates can apply |
| Rental property depreciation | Part of the gain may receive different treatment |
| NIIT | Higher-income households can face an extra 3.8% tax |
This table explains why the smartest question is rarely, “Can I sell this investment at 0%?” The better question is, “What happens to my entire tax return if I realize this gain?”
Appreciated Investments Can Also Be Useful for Charitable Giving

Retirees who already plan to give to charity may want to compare selling appreciated investments with donating eligible appreciated property directly.
IRS rules generally allow taxpayers donating qualifying long-term capital gain property to an eligible charity to use fair market value when calculating the charitable contribution, although deduction limits and special rules can apply.
A direct donation can also avoid the need for the donor to sell the appreciated asset and recognize the gain personally. The exact result depends on the property, charity, deduction limits, holding period, and whether the taxpayer itemizes.
This strategy makes sense only when the charitable gift was already part of the plan. Giving away $20,000 solely to avoid tax on a much smaller capital gain does not improve someone’s financial position.
Inherited Assets Can Start With a Very Different Cost Basis

Retirees who have inherited investments or property should verify the basis before assuming there is a large taxable gain.
The IRS says the basis of inherited property is generally its fair market value on the date of the previous owner’s death, although exceptions and alternative valuation rules can apply.
Consider an inherited investment worth $100,000 on the date of death. If it is later sold for $103,000 and the applicable inherited-property rules give it a $100,000 basis, the gain may be roughly $3,000 rather than the appreciation accumulated during the previous owner’s lifetime.
Inherited-property rules can become more complicated with trusts, jointly owned property, property previously gifted to the deceased person, and estate tax filings. Do not assume the original purchase price shown in old family records is automatically the correct basis.
A Simple Year-End Process Before Selling Appreciated Investments

A retiree considering a major investment sale can make the decision much safer by doing the tax estimate before the trade rather than after December 31.
Start with expected pension income, taxable IRA withdrawals, wages, interest, dividends, Social Security, and any other taxable income. Then estimate deductions and determine roughly how much ordinary taxable income will remain.
Next, add qualified dividends because they use part of the same preferential rate structure. Review prior returns for unused capital losses and check whether another investment sale is already scheduled.
Then estimate the long-term gain being considered and see where total taxable income lands against the 2026 threshold of $49,450 for single filers or $98,900 for married couples filing jointly.
Before pressing the sell button, also check Social Security taxation, Medicare MAGI, state taxes, charitable plans, and any large IRA withdrawal or Roth conversion planned for the same year.
For a large transaction, it can be worth asking a CPA, enrolled agent, or other qualified tax professional to run a tax projection using the actual accounts and tax return. One extra variable can change the result considerably.
