Capital Gains Tax Calculator

By Inch Calculator Team

Work out federal tax on a capital gain — long-term 0/15/20% rates stacked on your other income, plus the 3.8% NIIT and a short-term comparison. Enter your filing status, other taxable income and gain below to see what the gain costs.

This calculator covers US federal tax only — state capital gains tax is not included. Long-term means the asset was held more than one year. Thresholds are on taxable income (after the standard deduction: $16,100 single / $32,200 MFJ in 2026); enter taxable income directly — do not subtract the standard deduction again.

Capital Gains Tax Calculator

Capital Gains Tax Calculator

Federal tax only — state capital gains tax is not included. Long-term rates 2026: 0% up to $49,450 single / $98,900 MFJ / $66,200 HoH; 15% up to $545,500 single / $613,700 MFJ; 20% above. NIIT: extra 3.8% when MAGI is over $200,000 single / $250,000 MFJ.

Formula

Long-term tax = 0% on the part of the gain inside the 0% band + 15% on the part inside the 15% band + 20% above, plus 3.8% NIIT if MAGI is over the threshold

  • Ordinary income fills the 0% band first — the gain sits on top of it
  • 0% room left for the gain = 0% threshold − other taxable income (never below $0)
  • Short-term comparison: tax the gain at your ordinary marginal rates instead
  • NIIT = 3.8% × the smaller of (net investment income, MAGI − $200,000 single / $250,000 MFJ)

Worked Example

Worked example: a single filer with $30,000 of other taxable income sells an asset held 2 years for a $50,000 long-term gain.

  1. Total taxable income: $30,000 + $50,000 = $80,000
  2. 0% room left for the gain: $49,450 − $30,000 = $19,450 — that part of the gain is taxed at 0%
  3. The rest of the gain: $50,000 − $19,450 = $30,550, taxed at 15% = $4,582.50
  4. NIIT: $0 — MAGI of $80,000 is below the $200,000 single threshold
  5. Total federal tax on the gain: $4,582.50 (an effective rate of 9.17% on the gain)
  6. If the same gain were short-term: ordinary tax on $80,000 is $12,312, on $30,000 alone is $3,352 — so the gain would cost $8,960 in tax

Answer: the $50,000 long-term gain costs $4,582.50 in federal tax — $4,377.50 less than the $8,960 it would cost as a short-term gain

Tax on a $50,000 Long-Term Gain by Other Taxable Income

Other taxable incomeTax on the gainEffective rate
$0$82.500.17%
$30,000$4,582.509.17%
$80,000$7,500.0015.00%

Federal tax on a $50,000 long-term gain for a single filer, 2026.

What Is a Capital Gains Tax Calculator?

A capital gains tax calculator works out the federal tax you owe when you sell an asset for more than you paid. Gains on assets held more than a year get the lower long-term rates (0%, 15% or 20%), while gains on assets held a year or less are taxed at your ordinary income rate. Because the gain stacks on top of your other income, the same $50,000 gain can be nearly tax-free or taxed at 15% depending on what else you earned.

FAQs

How is a long-term capital gain taxed?

At 0%, 15% or 20% depending on your total taxable income. In 2026 a single filer pays 0% up to $49,450 of taxable income, then 15% up to $545,500. Your other income fills the 0% band first.

What counts as long-term?

An asset held for more than one year. One year or less is short-term and taxed at your ordinary income rate, which is almost always higher.

What is the 3.8% NIIT?

The net investment income tax: an extra 3.8% on gains when your modified AGI is over $200,000 (single) or $250,000 (joint). It is not in the worked example because that MAGI is $80,000.

Does this include state tax?

No — federal tax only. Most states tax capital gains as ordinary income, so your total bill would be higher. Enter your numbers above for the federal figure.

More Calculators

Try these other financial calculators: 401(k) Calculator, Retirement Calculator, Compound Interest Calculator, UK Income Tax Calculator, Canada Income Tax Calculator, Salary to Hourly Calculator.

Latest Videos

Capital Gains Taxes Explained: Short-Term Capital Gains vs. Long-Term Capital Gains — Charles Schwab explains short-term vs long-term capital gains, how the rates work and strategies to reduce the tax — the exact comparison this calculator makes.