Many retirees can sell investments that have grown for years and owe no federal tax on the profit. The 0% capital gains rate covers long-term gains as long as your taxable income stays under a set line. Here is where the line is in 2026 and 2027, how much income fits under it, how to use it on purpose and what to watch so it does not raise other bills.
Ray, 66, and Carol, 65, retired last year and plan to wait until 70 to claim Social Security. For now they live on $40,000 a year from Ray’s IRA plus $6,000 of bank interest. Years ago they put $100,000 into a stock fund in a regular brokerage account, and it is now worth $180,000. They assumed selling would mean a big tax bill. Because their other income is low, they can sell the whole fund this year, take the $80,000 gain and owe $0 in federal income tax.
Key takeaways
- Long-term capital gains and qualified dividends are taxed at 0% on the part that fits under $98,900 of taxable income for married couples filing jointly, or $49,450 for single filers, in 2026. In 2027 the line rises to $102,100 and $51,050.
- Taxable income is what is left after deductions. A married couple both 65 or older can have up to about $146,400 of income and still be under the line, if none of it is Social Security.
- Selling a winner and buying it back right away can reset your cost to today’s price for free. This is called tax-gain harvesting.
- Gains can still make more of your Social Security taxable, raise Medicare premiums two years later, cut health insurance subsidies before 65 and add state tax.
In this article7 sections
How the 0% rate works
A capital gain is the profit when you sell an investment for more than you paid. If you owned it for more than one year, it is a long-term gain, and it is taxed at 0%, 15% or 20% instead of at regular income tax rates. Qualified dividends from most U.S. stocks and stock funds get the same rates. Gains you held one year or less are short-term and are taxed like wages.
The rate depends on your taxable income, which includes the gain itself. Your regular income, such as pension, IRA withdrawals, interest and the taxable part of Social Security, fills the space first. Your long-term gains stack on top. The part of the gains that fits under the 0% line is tax free. Only the part above it is taxed at 15%.
| 2026 taxable income | Married filing jointly | Single | Head of household |
|---|---|---|---|
| 0% rate | Up to $98,900 | Up to $49,450 | Up to $66,200 |
| 15% rate | $98,901 to $613,700 | $49,451 to $545,500 | $66,201 to $579,600 |
| 20% rate | Over $613,700 | Over $545,500 | Over $579,600 |
For 2027, the IRS has raised the lines:
| 2027 taxable income | Married filing jointly | Single | Head of household |
|---|---|---|---|
| 0% rate | Up to $102,100 | Up to $51,050 | Up to $68,350 |
| 15% rate | $102,101 to $633,600 | $51,051 to $563,200 | $68,351 to $598,400 |
| 20% rate | Over $633,600 | Over $563,200 | Over $598,400 |
The 0% rate applies only to gains in regular taxable accounts, such as a brokerage account, and to a home sale profit above the $250,000 or $500,000 exclusion. Gains inside an IRA or 401(k) do not count here, because withdrawals from those accounts are taxed as regular income no matter what the account holds.
How much income fits under the line
Because the line is measured after deductions, the total income you can have is higher than the line itself. In 2026 a married couple gets a $32,200 standard deduction plus $1,650 for each spouse 65 or older. On top of that, the senior deduction adds $6,000 for each person 65 or older from 2025 through 2028, as long as income stays under $150,000 for couples or $75,000 for single filers.
| 2026, everyone 65 or older | Married filing jointly | Single |
|---|---|---|
| 0% line (taxable income) | $98,900 | $49,450 |
| Standard deduction with the extra amount at 65 | $35,500 | $18,150 |
| Senior deduction | $12,000 | $6,000 |
| Income that can fit under the line | About $146,400 | About $73,600 |
Income here means adjusted gross income, which counts only the taxable part of Social Security. If you itemize instead, use your itemized total in place of the standard deduction.
In 2027 the standard deduction rises to $33,200 for couples and $16,600 for single filers, and the extra amount at 65 becomes $1,700 per spouse or $2,100 if single. A couple both 65 or older can then have about $150,600 of income under the line, and a single filer about $75,700. At those amounts the senior deduction has just started to shrink, so both figures are rounded.
Ray and Carol’s numbers
| Step | Amount |
|---|---|
| IRA withdrawals and interest | $46,000 |
| Long-term gain from selling the fund | $80,000 |
| Adjusted gross income | $126,000 |
| Deductions: $32,200 + $3,300 at 65 + $12,000 senior deduction | -$47,500 |
| Taxable income, all of it from the gain | $78,500 |
| Room left under the $98,900 line | $20,400 |
| Federal income tax | $0 |
Their deductions are larger than their regular income, so that income is not taxed at all, and the leftover deduction shelters part of the gain too. The rest of the gain fits under the 0% line. If they waited until Social Security and required minimum distributions filled the lower brackets, the same $80,000 gain taxed at 15% would cost $12,000.
Tax-gain harvesting: using the room on purpose
You do not need to spend the money to use the 0% rate. Selling an investment and buying it back resets your cost basis, the price the IRS treats as what you paid, to today’s value. Future gains are then measured from the higher price, and the gain you took was tax free. The wash-sale rule, which blocks buying back right away, applies only to losses, not to gains.
- Estimate this year’s taxable income in November or December: pension, IRA withdrawals, interest, dividends, the taxable part of Social Security, minus your deductions.
- Find your room: the 0% line minus that taxable income.
- Pick the shares to sell. Choose shares held more than one year with the largest gains. Ask your brokerage to sell specific lots so you control which shares go. Rebalancing without a tax problem explains tax lots.
- Sell and, if you want, buy back the same fund the same day. The new shares start a new holding period, so wait more than a year before selling them for another long-term gain.
- Leave a cushion of a few thousand dollars. Mutual funds often pay capital gain distributions in December, and those count too.
- Keep the confirmations. Your brokerage reports the sale on Form 1099-B early next year.
This is a good item for your year-end checklist, because the sale has to happen by the last trading day of December to count for the year.
What the gain can still affect
A gain taxed at 0% still raises your adjusted gross income. Several other numbers depend on that income.
- Social Security. A gain can make more of your benefit taxable. In some income ranges, each $1,000 of gain can make up to $850 more of your benefit taxable, and that part is taxed as regular income. It can also push some of the gain over the 0% line. See how Social Security benefits are taxed.
- Medicare premiums. Your income from two years ago sets IRMAA, the extra charge on Part B and Part D. For 2026 it starts above $109,000 for single filers and $218,000 for couples. For 2027 it starts above $112,000 and $224,000. A gain inside the 0% range rarely gets there, but a large sale on top of other income can.
- Health insurance before 65. Premium tax credits for a Marketplace plan depend on your income, and in 2026 they stop entirely above 400% of the poverty level. A gain can cost you more in lost help than you save in tax. See health insurance before Medicare.
- The senior deduction. It shrinks once income passes $75,000 for single filers or $150,000 for couples, which means a gain past that point can raise the tax on your other income.
- State tax. Most states with an income tax treat capital gains as regular income, so the 0% rate is federal only. See state taxes on retirement income.
When it may not pay to harvest gains
- You plan to leave the investment to your heirs. When you die, their cost basis generally steps up to the value on the date of death, so the gain disappears anyway.
- Roth conversions need the same room. A conversion is taxed as regular income and fills the same space first, pushing gains into the 15% rate. Many retirees with large IRAs get more from converting in the low-income years. See the Roth conversion window before RMDs and compare the two with a tax preparer.
- You have a capital loss carryover. Old losses offset this year’s gains first, so they would be used up on gains that would have been taxed at 0% anyway, instead of reducing up to $3,000 of regular income each year.
- You get income-based help. Marketplace subsidies, Medicare Savings Programs or Extra Help can shrink when your income rises.
Frequently asked questions
If my income is low, are all my gains tax free?
Only the part that fits under the 0% line. If your taxable income is $90,000 as a couple and you add a $20,000 gain, $8,900 is taxed at 0% and $11,100 at 15%.
Can I sell and buy the same fund back the same day?
Yes. The wash-sale rule only stops you from claiming a loss when you buy back within 30 days. With a gain you can buy back right away, and your new cost basis is the price you paid that day.
Do mutual fund capital gain distributions count?
Yes. They are treated as long-term gains no matter how long you have owned the fund, and they use up part of your 0% room.
Is there a separate 3.8% tax on investment income?
Only above $200,000 of modified adjusted gross income for single filers or $250,000 for couples. Those amounts are not adjusted for inflation. Anyone using the 0% rate is well below them.
Does selling my house count?
Only the profit above your home sale exclusion. That part is a long-term capital gain and can use the 0% rate if it fits under the line.
Educational note: This article is general education, not tax, legal or investment advice. Ray and Carol are an illustrative example. The main figures are for 2026, with 2027 amounts where the IRS has published them. They change each year. How Social Security, Medicare premiums, health insurance subsidies and state taxes respond to a gain depends on your full return, so run the numbers in tax software or with a tax professional before a large sale.
Sources
- IRS Revenue Procedure 2025-32: 2026 inflation adjustments (capital gains rate amounts, standard deduction)
- IRS Revenue Procedure 2026-35: 2027 inflation adjustments
- IRS Topic 409: Capital gains and losses
- IRS: The enhanced deduction for seniors
- IRS Publication 550: Investment Income and Expenses (wash sales, capital gain distributions)
- IRS Publication 551: Basis of Assets (inherited property)
- IRS Publication 915: Social Security and Equivalent Railroad Retirement Benefits
- IRS Topic 559: Net investment income tax




