↑ ↓ to move · Enter to open · Esc to close

📈 Capital Gains Tax Calculator

Calculate the 2026 US federal tax on selling a stock, fund, crypto or property – long-term 0/15/20% rates vs. short-term ordinary rates, including the 3.8% NIIT.

Quick answer: Selling for $35,000 a stock bought for $20,000 gives a $15,000 gain; held over a year, a single filer with $75,000 of other income pays $2,250 (15%) in 2026 federal capital gains tax – versus $3,300 if held a year or less.

Updated · Free · No sign-up · Works on any device

Capital Gains Tax Calculator inputs

$
Include buying commissions and improvements.
$
After selling costs.
$
Wages and other ordinary income for the year, before the standard deduction.

Result

Long-term capital gains tax

$2,250.00

15% of your $15,000.00 gain

Sale price$35,000.00
Cost basis−$20,000.00
Capital gain$15,000.00
Federal tax at 0/15/20% rates$2,250.00
Net investment income tax (3.8%)$0.00
Total tax on the gain$2,250.00
You keep$32,750.00
Taxed at 0%
$0
Taxed at 15%
$15,000
Taxed at 20%
$0
Saved vs. short-term
$1,050.00

2026 federal rates for single filers with the standard deduction. State tax and collectibles (28%) / real-estate depreciation recapture (25%) rates are not included.

Short-term vs. long-term

Short-term (≤ 1 year)Long-term (> 1 year)
Federal income tax$3,300.00$2,250.00
NIIT (3.8%)$0.00$0.00
Total tax$3,300.00$2,250.00
Effective rate on gain22%15%

2026 long-term capital gains brackets – single

RateTaxable income (including the gain)
0%up to $49,450
15%$49,450 – $545,500
20%over $545,500
+3.8% NIITMAGI over $200,000
</> Embed this calculator on your website – free, no sign-up, no ads inside

Copy this code into any web page, blog post or CMS (WordPress, Wix, Squarespace, Webflow…). It stays up to date automatically, works on mobile and picks your visitor's currency.

Preview

How to use the capital gains tax calculator

  1. Enter what you paid (your cost basis, including commissions) and what you sold for.
  2. Choose whether you held the asset more than one year.
  3. Enter your other income for the year and your filing status – the gain is stacked on top of it, which decides your rate.

The formula

Capital gain = Sale price − Cost basis

Short-term: tax = income tax on (other income + gain) − income tax on other income alone.

Long-term: the gain fills the 0%, 15% and 20% bands starting from where your ordinary taxable income ends.

NIIT = 3.8% × min(Gain, MAGI − threshold)

Worked example

A single filer earning $75,000 sells shares for $35,000 that cost $20,000 – a $15,000 gain. After the $16,100 standard deduction, ordinary taxable income is $58,900, already above the $49,450 top of the 0% band, so the whole gain is taxed at 15%: $2,250. Had the shares been held a year or less, the gain would be taxed at the 22% bracket rate: $3,300. Waiting saves $1,050. MAGI of $90,000 is below $200,000, so no NIIT applies.

2026 long-term capital gains tax rates

RateSingleMarried filing jointlyHead of householdMarried filing separately
0%up to $49,450up to $98,900up to $66,200up to $49,450
15%$49,450 – $545,500$98,900 – $613,700$66,200 – $579,600$49,450 – $306,850
20%over $545,500over $613,700over $579,600over $306,850

Thresholds are taxable income including the gain. Collectibles are taxed at up to 28% and unrecaptured real-estate depreciation at up to 25%, which this calculator does not model; nor does it include state tax.

Sources: IRS Rev. Proc. 2025-32 §4.03 and IRS Topic No. 409 / 559 (irs.gov).

Estimates for educational purposes, not financial advice.

Frequently asked questions

What are the 2026 long-term capital gains tax brackets?

For 2026, long-term gains are taxed at 0% up to $49,450 of taxable income for single filers ($98,900 married filing jointly, $66,200 head of household), 15% up to $545,500 ($613,700 joint, $579,600 head of household) and 20% above that.

How are short-term capital gains taxed?

Gains on assets held one year or less are taxed as ordinary income at your regular 10%–37% bracket rates, stacked on top of your other income.

What is the 3.8% net investment income tax?

NIIT is an extra 3.8% on the smaller of your net investment income and the amount your MAGI exceeds $200,000 (single or head of household), $250,000 (married filing jointly) or $125,000 (married filing separately). These thresholds are not indexed for inflation.

How do I avoid or reduce capital gains tax?

Hold investments more than a year, harvest losses to offset gains, sell in a lower-income year to use the 0% bracket, give appreciated shares to charity, and use tax-advantaged accounts. Up to $250,000 ($500,000 joint) of gain on a main home is also excluded if you meet the 2-of-5-year rule.

Can capital losses reduce my taxes?

Yes. Losses offset gains first, then up to $3,000 a year ($1,500 married filing separately) of other income. Unused losses carry forward to future years.