Capital Gains Tax Calculator
It estimates the federal tax on selling an investment, applying the long-term 0/15/20% bands stacked on top of your ordinary income, plus the net investment income surtax.
Federal tax on the gain
$15,000.00
| Rate | Gain in band | Tax |
|---|---|---|
| 15% | $100,000 | $15,000 |
Gain
$100,000
Long-term tax
$15,000
Short-term tax
$23,164
Net investment tax
$0
Saved by holding
$8,164
Net proceeds
$185,000
Federal estimate only, and not tax advice. State capital gains tax is not included and varies widely — confirm your position with a tax professional.
What it calculates
It estimates the federal tax on selling an investment, applying the long-term 0/15/20% bands stacked on top of your ordinary income, plus the net investment income surtax.
Why it matters
The gap between short-term and long-term treatment is enormous. On a large gain, holding a few extra weeks past the one-year mark can save five figures.
Who it's for
Anyone selling stock, crypto, a second property or a business stake, and investors planning which lots to sell and when.
Formula
- B
- Basis — what you originally paid
- S
- Sale price
- G
- Gain, which is S − B
- TI
- Taxable ordinary income, which decides the band
Worked example
$100,000 long-term gain on $80,000 of income
- 1Taxable income = 80,000 − 16,100 standard deduction = $63,900
- 2The gain stacks on top, running from 63,900 to 163,900
- 3That whole range sits inside the 15% band
- 4MAGI of 180,000 is under the NIIT threshold, so no surtax
$15,000 of federal capital gains tax
How the capital gains tax calculator works
Long-term gains are not taxed in isolation. They stack on top of your taxable ordinary income, and the 0%, 15% and 20% bands are measured from that starting point — which is why one sale can be taxed at two different rates. Short-term gains, on assets held a year or less, are treated as ordinary income and taxed at your marginal rate. Above $200,000 of modified AGI ($250,000 married), a further 3.8% Net Investment Income Tax applies to the lesser of your investment income and the amount over the threshold. Losses offset gains first, then up to $3,000 of ordinary income a year, with anything left carried forward.
Long-term gains are not taxed in isolation. They sit on top of your taxable ordinary income, and the 0%, 15% and 20% bands are measured from there — which is why one sale can be taxed at two different rates at once.
Short-term gains, on anything held a year or less, are simply ordinary income. On a large gain the difference between the two treatments is usually the largest number on this page.
Common mistakes
- Assuming a flat 15% instead of stacking the gain on top of ordinary income.
- Forgetting the 3.8% net investment income surtax at higher incomes.
- Selling a day short of the one-year mark and paying ordinary rates on the whole gain.
- Ignoring state capital gains tax, which this calculator does not include.
Tips and best practice
- Check the purchase date before selling — one year and one day is the threshold, not one year.
- Harvest losses in the same tax year to offset gains directly.
- In a low-income year, part of a gain may genuinely be taxed at 0%.
Frequently asked questions
How much is capital gains tax?
Long-term gains are taxed at 0%, 15% or 20% depending on your taxable income. Short-term gains are taxed as ordinary income at your marginal rate, which can be far higher.
What counts as long-term?
An asset held for more than one year before sale. The clock starts the day after purchase, so selling on the anniversary itself is still short-term.
Does the capital gain push me into a higher bracket?
It stacks on top of your ordinary taxable income for the purpose of choosing the capital gains band, so a large gain can move part of itself from 15% into 20%.
What is the net investment income tax?
An extra 3.8% on investment income once modified AGI clears $200,000 single or $250,000 married. Those thresholds are not adjusted for inflation.
Can I deduct a capital loss?
Losses offset gains first. Beyond that you may deduct up to $3,000 against ordinary income each year, carrying the remainder forward indefinitely.
Related calculators
Methodology & trust
- Formula source
- IRS Topic 409 and Rev. Proc. 2025-32 rate thresholds for 2026
- Last updated
- 2026-07-28
- Privacy
- Every calculation runs in your browser. No inputs are sent to a server or stored.