How are capital gains taxed in 2026?

A capital gain is the sale price of shares, minus what you paid for them (your cost basis), minus selling costs. How the gain is taxed depends first on how long you owned the shares. Hold them more than one year and the gain is long-term, taxed at 0%, 15% or 20% depending on your taxable income. Hold them a year or less and the gain is short-term, taxed as ordinary income at the same rates as an IRA withdrawal or a pension (IRS Topic 409). Two narrower categories carry higher caps: gains on collectibles such as coins and art are taxed at up to 28%, and the part of a real estate gain that reflects past depreciation at up to 25%. This calculator covers stocks, bonds and funds.

The long-term rate is not set by the size of the gain alone. It is set by where the gain lands in your taxable income once your other income is counted. The table gives the 2026 thresholds, from Revenue Procedure 2025-32. Qualified dividends are taxed on the same schedule.

2026 long-term capital gains tax brackets by filing status
Filing status0% rate up to15% rate up to20% rate above
Single$49,450$545,500$545,500
Married filing jointly$98,900$613,700$613,700
Head of household$66,200$579,600$579,600
Married filing separately$49,450$306,850$306,850

Thresholds are taxable income, after the standard or itemized deduction, for tax year 2026 (Revenue Procedure 2025-32). Short-term gains have no table of their own: they are taxed at the ordinary rates of 10% to 37% (IRS Topic 409); see the tax bracket calculator for those.

For a married couple, the 0% rate covers taxable income up to $98,900, which on top of a $32,200 standard deduction, the extra $1,650 each for being 65 or older and the new $6,000-per-person senior deduction, means a retired couple can have well over $140,000 of total income and still owe nothing on some long-term gains. The 20% rate, at the other end, starts above $613,700 of taxable income for a couple. Most retirees who sell stock pay 15%, and the question that matters is what else the gain sets off.

How a gain stacks on top of your other income

The IRS worksheet that applies the capital gains rates fills your taxable income from the bottom with ordinary income first: wages, pensions, IRA withdrawals, taxable Social Security and interest. Qualified dividends and long-term gains sit on top. Only the part of that top layer that falls below the 0% threshold is taxed at 0%; the part between the thresholds pays 15%; the rest pays 20%. So a gain never changes the tax on your ordinary income directly, but your ordinary income decides which rate the gain pays.

Illustrative example: the people and figures below are hypothetical, not real clients. Numbers are calculated from the stated assumptions.

Take the couple the calculator opens on: 71 and 68, with $72,000 of IRA withdrawals, a $30,000 pension, $58,000 of Social Security, $6,000 of interest, $14,000 of dividends ($12,000 qualified) and $4,000 of municipal bond interest, living in a state with a 5% income tax that exempts Social Security. Before any sale their adjusted gross income is $171,300 and their taxable income $126,356, of which $114,356 is ordinary income. That is already above the $98,900 top of the 0% band, so every dollar of gain they add pays at least 15%.

They sell shares for $150,000 that cost $60,000: a $90,000 long-term gain. At 15%, that is $13,500. But the calculator shows federal tax rising by $15,578. The extra $2,078 is the senior deduction: it shrinks by 6 cents for every dollar of income above $150,000 for a couple, and the gain pushes their income far enough to erase the $9,444 they had left. That much more ordinary income is now taxed at 22%. Then the gain lifts their adjusted gross income to $261,300, $11,300 over the net investment income tax threshold, which adds $429. The state takes $4,500. And two years later, the higher income moves them into the first Medicare surcharge tier, which costs the two of them about $2,297 in 2028.

All together, the sale costs about $22,804, or 25.3% of the gain, although the headline capital gains rate is 15%. Had they owned the same shares for a year or less, the gain would be taxed as ordinary income and the total would be about $29,152.

The 3.8% net investment income tax

The net investment income tax (NIIT) is a 3.8% federal tax on top of the capital gains rate. It applies to the smaller of two amounts: your net investment income, or how far your modified adjusted gross income exceeds $250,000 for a married couple filing jointly, $200,000 for single filers and heads of household, or $125,000 if married filing separately (IRS Topic 559). You figure it on Form 8960.

Net investment income includes interest, dividends, rents, royalties, non-qualified annuity income and net gains from selling stocks, bonds, funds and investment real estate. It does not include wages, Social Security benefits, tax-exempt interest, or distributions from IRAs, 401(k)s, 403(b)s and other qualified plans (IRS questions and answers on the NIIT). That last exclusion matters to retirees: an IRA withdrawal or a Roth conversion is not itself subject to the tax, but it raises your adjusted gross income, which can push your investment income over the line.

The thresholds are written into the law and are not indexed for inflation (IRS), so each year more households reach them. A couple with a $72,000 RMD, a pension and Social Security can sit just below $250,000 and cross it only in the year they sell a block of shares. In that year the tax falls on the gain above the threshold, not on the whole gain, which is why the example couple pays $429 rather than 3.8% of $90,000.

How a gain can make more Social Security taxable

Up to 85% of Social Security benefits is taxable, depending on your provisional income: your other income, including tax-exempt interest and capital gains, plus half of your benefits. Above $32,000 for a married couple ($25,000 for single filers) up to half of benefits becomes taxable, and above $44,000 ($34,000) up to 85% (IRS Publication 915). These amounts were set in 1983 and 1993 and are not indexed for inflation, so they catch more retirees every year.

A capital gain counts in provisional income in full. So for a household whose benefits are not yet 85% taxable, each dollar of gain can drag up to 85 cents of Social Security into taxable income, and that Social Security is taxed at ordinary rates. The result is a long-term gain that sits entirely in the 0% band and still costs real tax.

Illustrative example: the people and figures below are hypothetical, not real clients. Numbers are calculated from the stated assumptions.

A married couple, both 74, has $60,000 of Social Security and $50,000 of IRA withdrawals. Their taxable income is $39,100. They sell shares with a $20,000 long-term gain, and all of it lands in the 0% band: $20,000 of gain taxed at 0%. Yet their federal tax rises by $1,728, because the gain makes $14,400 more of their benefits taxable, taxed at 10% and 12%. That is 8.6% of a gain that a simple calculator would say is tax-free. Our calculator shows this extra taxable Social Security separately whenever a sale causes it.

Compare a single filer, 72, with a $40,000 pension and no Social Security in the calculation: a $30,000 gain costs $0, because it fits inside the 0% band and there are no benefits for it to pull into tax. The difference between the two is not the gain; it is everything around it.

The Medicare surcharge that arrives two years later

Medicare Part B and Part D premiums rise with income. The income-related monthly adjustment amount (IRMAA) is set from the modified adjusted gross income on your tax return from two years earlier, which is your adjusted gross income plus tax-exempt interest (SSA). A sale in 2026 therefore sets your premiums for 2028. In 2026 the standard Part B premium is $202.90 a month; the first surcharge tier starts above $218,000 of income for a couple and $109,000 for a single person, where Part B rises to $284.10 and Part D adds $14.50 a month (CMS 2026 fact sheet).

IRMAA is a cliff, not a rate. One dollar over a threshold costs the whole tier, for each person on Medicare, for the whole year.

Illustrative example: the people and figures below are hypothetical, not real clients. Numbers are calculated from the stated assumptions.

A married couple, both 70, draws $150,000 from IRAs and has a $60,000 pension: income of $210,000, $8,000 below the first tier. They sell shares with a $10,000 long-term gain. Federal tax rises by $1,764, which is 15% of the gain plus a little more from the shrinking senior deduction. But their income is now $220,000, and in 2028 each of them pays about $1,148 more for Medicare: $2,297 for the couple. The sale costs $4,061, 40.6% of the gain. Had they kept the gain under $8,000, the surcharge would not have applied. The “room before the next threshold” table in the calculator shows that number for your household.

Two caveats. The calculator prices the 2028 surcharge with the 2026tiers and premiums; the thresholds are adjusted for inflation each year, so treat the figure as an estimate. And a one-time sale is not a life-changing event that lets you ask Social Security to use a lower year's income; retirement, the death of a spouse and a few other events are (SSA). Our IRMAA calculator and the guide to Medicare enrollment and IRMAA cover the tiers in more depth.

State tax on capital gains

Most states with an income tax treat capital gains as ordinary income, with no lower rate for long-term gains; a handful have no income tax, and a few give a partial exclusion or tax only some gains. The calculator applies your state's marginal rate to the change in income the sale causes, and leaves Social Security out unless you say your state taxes it. That is a rough figure: it ignores state deductions, credits and brackets that change within the gain. If you are planning to move in retirement, the year of a large sale and the state you live in that year can matter as much as the federal rate.

Losses, carryovers and cost basis

How losses offset gains

Losses you realize in the same year offset gains first: short-term losses against short-term gains, long-term against long-term, and then the net of each against the other. If losses exceed gains, up to $3,000 of the net loss ($1,500 if married filing separately) reduces your ordinary income, and the rest carries forward to later years with no time limit (IRS Topic 409). The calculator asks for any carryover from last year and treats it as long-term, which is how most carryovers from stock losses arise.

A carryover is valuable in retirement precisely because it shelters gains you may need to take. Our tax-loss harvesting guide covers how losses are created, and the wash sale rule: a loss is disallowed if you buy substantially identical shares within 30 days before or after the sale (IRS Publication 550).

Cost basis and choosing which shares to sell

Your basis is what you paid, including commissions, plus reinvested dividends that bought more shares. If you bought the same stock or fund at different times, each purchase is a separate lot with its own basis and holding period, and which lots you sell changes the gain. Unless you identify specific shares when you sell, the IRS treats the earliest shares as sold first (IRS Publication 550; mutual fund shares can use an average cost instead), and for an investment held for decades those are usually the ones with the largest gain. Most brokers let you choose a lot method in advance or pick lots at the time of each sale. Selling the highest-basis lots first can turn the same $150,000 of proceeds into a much smaller gain, or into a loss. Shares you inherited are always treated as long-term, and their basis is generally their value on the date of death (IRS Publication 550). Shares you were given generally keep the giver's basis for figuring a gain.

Ways to lower the tax on a sale

None of these is a reason to sell or to hold a particular investment; they are ways of arranging a sale you have already decided on. Each one changes a number you can test in the calculator.

Spread the sale across two tax years

Brackets, the NIIT threshold and the IRMAA tiers all reset every January. Splitting a sale between December and January can keep each year below a threshold that one large sale would cross. Run the calculator once with half the shares, then imagine the same household next year.

Use the 0% bracket in low-income years

Years between retirement and the start of Social Security and RMDs often have unusually low taxable income. Selling shares with gains in those years, and buying them back if you want to keep the position, resets your basis higher at no federal tax as long as the gain fits in the 0% band. This is tax-gain harvesting, and the wash sale rule does not apply to gains. A married couple with taxable income near the top of the $100,800 12% bracket is already near the limit; one with taxable income of $40,000 has nearly $60,000 of room. Mind Social Security, though: as the example above shows, a 0% gain is not free when it makes benefits taxable.

Give appreciated shares instead of cash

If you itemize and already give to charity, giving long-held shares directly to the charity, or to a donor-advised fund, avoids the tax on their gain. The deduction is generally the shares' fair market value, limited to 30% of adjusted gross income for gifts to public charities, with a five-year carryover of any excess (IRS Publication 526). You can then use the cash you would have given to buy new shares with a full basis. See our guide to donor-advised funds.

Fund giving from an IRA with a QCD

From 70½, a qualified charitable distribution sends up to $111,000 a year in 2026 straight from an IRA to charity. It counts toward your RMD and never enters adjusted gross income, so it lowers the income that sets the capital gains rate, the NIIT, Social Security taxation and IRMAA, even if you take the standard deduction. A household that gives and also needs to sell shares can often fund the giving from the IRA and keep the gain lower. See qualified charitable distributions.

Hold for the step-up in basis

Shares held until death generally get a new basis equal to their value on the date of death, so the gain built up during your lifetime is never taxed as income. For a heavily appreciated holding that you do not need to spend, that is often the largest saving of all, and it is worth weighing against the cost of selling now. It is a decision about your estate as well as your taxes.

Pair gains with losses

Realizing losses in the same year, or using a carryover, offsets gains dollar for dollar before any rate applies, and it lowers adjusted gross income for every threshold on this page. Our guide to taxes in retirement puts these pieces together with withdrawal order and Roth conversions.

Check the numbers behind any plan

The full cost of a sale is the difference between your tax with it and without it. The retirement numbers page collects every 2026 threshold on one page.

What the calculator leaves out

It is an estimate of one sale for one household in 2026. It does not model the alternative minimum tax, tax credits, collectibles and real estate depreciation recapture, gains on a home sale, the phase-out of the state's own deductions, or married couples filing separately. It assumes the larger of the standard deduction or your itemized deductions, and that everyone 65 or older by the end of 2026 claims the senior deduction. It decides who is on Medicare in 2028 by age alone. The federal figures follow the IRS worksheets and match them for the households we tested, but your return is the final word.

Bring this to your CPA

Use the calculator to see what a sale costs, then take these questions to the person who prepares your return or manages your account.

  1. Which tax lots would this sale use, and would choosing different lots lower the gain?
  2. How close are we to the $250,000 NIIT threshold ($200,000 single) and the next IRMAA tier this year?
  3. Would splitting the sale between this year and next lower the total cost, including Medicare premiums two years out?
  4. Do we have loss carryovers or unrealized losses that could offset this gain?
  5. Would giving appreciated shares or making QCDs cover our charitable giving more cheaply than giving cash?
  6. How does our state tax this gain, and does it tax our Social Security?

Sources