Capital Gains Tax Calculator

Estimate the 2026 federal tax on selling a stock, fund or other investment.

Before you rely on this result. Tax rules change and depend on where you live and your circumstances. Treat this as an estimate and check current rules with your tax authority or a qualified adviser before you file or plan around it. Sources used on this page.

How it's worked out

First the gain. Your basis is what you paid plus buying costs and, for property, improvements. The amount realized is the sale price minus selling costs.

gain\displaystyle \text{gain}=(sale price−selling costs)−(price paid+buying costs+improvements)\displaystyle {}= (\text{sale price} - \text{selling costs}) - (\text{price paid} + \text{buying costs} + \text{improvements})

Then the holding period. A gain is long-term if you held the asset more than one year. The count starts the day after you bought it, so the first long-term day is the day after the one-year anniversary (IRS Publication 550). Inherited property is always long-term.

A short-term gain is simply added to your other income and taxed at the 2026 bracket rates, from 10% to 37%. A long-term gain is stacked on top of your other taxable income and taxed in bands:

  • 0% on the part that fits under $49,450 of taxable income ($98,900 married filing jointly, $66,200 head of household).
  • 15% on the part up to $545,500 ($613,700 joint), and 20% above that.
  • 3.8% net investment income tax on the gain where your income passes $200,000 ($250,000 joint).

Taxable income is your income minus the standard deduction ($16,100 single, $32,200 joint in 2026) or your itemized deductions. The tax shown is the extra tax this sale adds to your year.

Worked examples

Dana sells shares held two years

Dana paid $20,000 in March 2024 and sells for $50,000 in June 2026: a $30,000 long-term gain. She is single with $60,000 of income. After the $16,100 standard deduction, that leaves room for $5,550 of the gain at 0%, and the other $24,450 is taxed at 15%.

Her tax is $3,667.50, an effective 12.2% of the gain. Had she sold inside a year, it would have been $5,950.00. If she also sells a holding that is down $5,000, the tax falls by $750.00. Open this example in the tool

Ten months in: sell now or wait?

Shares bought on September 2, 2025 for $12,000 are worth $18,500. Selling on July 1, 2026 makes the $6,500 gain short-term, and at $85,000 of income it costs $1,430.00. The first long-term day is September 3, 2026. Selling then, at the same price, would cost $975.00. Open this example in the tool

A retired couple in the 0% band

A married couple with $70,000 of pension and other income sells a fund for a $40,000 long-term gain. After their $32,200 standard deduction, the whole gain fits under the $98,900 limit, so the federal tax is $0. Open this example in the tool

Reading your result

A long-term gain never pushes your wages into a higher bracket. It only fills the bands above them. So the effective rate on the gain can be well under 15%, as in Dana's 12.2%.

The chart under the tool shows the same idea for every income. The long-term line stays flat at $0 while the whole gain still fits in the 0% band, then bends upward once part of it spills into the 15% band. The retired couple sits on the flat part; Dana is already past the bend. The short-term line never stays flat, because every dollar of a short-term gain is taxed like wages.

The net investment income tax is where high earners get surprised. A single filer with $250,000 of income and a $100,000 gain owes $15,000.00 at 15% plus $3,800.00 of NIIT. The NIIT thresholds are written into the law and do not rise with inflation (IRS, questions and answers on the NIIT).

All the 2026 brackets, limits and the standard deduction come from IRS Revenue Procedure 2025-32, checked on October 27, 2026. The IRS adjusts them for inflation every year, so a sale in another year uses different limits.

Common mistakes

  • Selling on the anniversary. A sale exactly one year after the purchase is still short-term. Wait one more day.
  • Leaving out costs and reinvested dividends. Commissions, closing costs and dividends you reinvested all raise your basis and lower the gain. Check the basis your broker reports.
  • Using this for a home or a rental. A main home can exclude up to $250,000 of gain ($500,000 joint) if you meet the ownership and use tests, and a rental adds depreciation recapture. Neither is in this estimate (IRS Topic 701, sale of your home).
  • Buying back too soon after a loss. Buying the same security within 30 days before or after the loss sale defers the loss under the wash sale rule.
  • Forgetting state tax. Most states tax gains as ordinary income. Add your rate with the extras switch.

Questions people ask

Sources

Maintained by Updated October 28, 2026Checked against 8 reference values