Skip to main content
myfinancemyntra

Capital Gains Tax Calculator (2025 Federal Rates)

Estimate the federal tax on an investment sale — short-term vs long-term, with the 3.8% surtax where it applies.

Updated July 23, 2026More taxes tools

Your numbers

You

Your taxable income before this gain.

The sale

Capital gains tax

$3,000

2025 federal estimate.

Capital gain
$20,000
Federal tax on gain
$3,000
Net Investment Income Tax
None
Effective rate
15%
After-tax gain
$17,000
If sold short-term
$4,400

For comparison.

Where it goes

  • You keep85%
  • Federal tax15%

Your personalized analysis

Summary

You'd owe about $3,000 on a $20,000 long-term gain

That's an effective rate of 15% on the gain, leaving you $17,000. Long-term gains get preferential 0%, 15% or 20% rates based on your total income. Figures use 2025 federal rules.

Recommendation$1,400 less than short-term

Holding long-term saved you $1,400

If you'd sold this at a short-term gain (held one year or less), it would be taxed as ordinary income — about $4,400 instead of $3,000 in federal tax. The one-year holding line is one of the highest-value dates in investing: crossing it can cut the tax on a gain by more than half.

Next step

See how the gain affects your whole tax picture

A capital gain raises your total income, which can ripple into other thresholds — IRMAA Medicare surcharges, ACA subsidies, the NIIT. Model your full federal tax with and without the sale to see the complete effect.

Federal income tax calculator

Example calculations

Worked scenarios with the full analysis, so you can see how the numbers move before entering your own.

$20,000 long-term gain on $80,000 income

A single filer selling a long-held investment for a $20,000 profit — most of it taxed at the 15% long-term rate.

Capital gains tax

$3,000

Capital gain
$20,000
Federal tax on gain
$3,000
Net Investment Income Tax
None
Effective rate
15%
After-tax gain
$17,000
If sold short-term
$4,400
Summary

You'd owe about $3,000 on a $20,000 long-term gain

That's an effective rate of 15% on the gain, leaving you $17,000. Long-term gains get preferential 0%, 15% or 20% rates based on your total income. Figures use 2025 federal rules.

Recommendation$1,400 less than short-term

Holding long-term saved you $1,400

If you'd sold this at a short-term gain (held one year or less), it would be taxed as ordinary income — about $4,400 instead of $3,000 in federal tax. The one-year holding line is one of the highest-value dates in investing: crossing it can cut the tax on a gain by more than half.

Next step

See how the gain affects your whole tax picture

A capital gain raises your total income, which can ripple into other thresholds — IRMAA Medicare surcharges, ACA subsidies, the NIIT. Model your full federal tax with and without the sale to see the complete effect.

Federal income tax calculator

The same gain, but short-term

Identical sale held one year or less, taxed as ordinary income to show the cost of selling early.

Capital gains tax

$4,400

Capital gain
$20,000
Federal tax on gain
$4,400
Net Investment Income Tax
None
Effective rate
22%
After-tax gain
$15,600
If held long-term
$3,000
Summary

You'd owe about $4,400 on a $20,000 short-term gain

That's an effective rate of 22% on the gain, leaving you $15,600. Short-term gains are taxed as ordinary income at your marginal rate of 22%. Figures use 2025 federal rules.

Watch out$1,400 of avoidable tax

Waiting for long-term treatment would save $1,400

This gain is short-term, so it's taxed as ordinary income at your 22% marginal rate — about $4,400. Held for more than a year, the same gain would qualify for long-term rates and cost roughly $3,000. If you're close to the one-year mark, waiting can be worth $1,400.

Next step

See how the gain affects your whole tax picture

A capital gain raises your total income, which can ripple into other thresholds — IRMAA Medicare surcharges, ACA subsidies, the NIIT. Model your full federal tax with and without the sale to see the complete effect.

Federal income tax calculator

$20,000 long-term gain on $40,000 income

A lower-income filer whose gain falls partly or fully in the 0% long-term capital gains bracket.

Capital gains tax

$1,748

Capital gain
$20,000
Federal tax on gain
$1,748
Net Investment Income Tax
None
Effective rate
8.7%
After-tax gain
$18,253
If sold short-term
$3,553
Summary

You'd owe about $1,748 on a $20,000 long-term gain

That's an effective rate of 8.7% on the gain, leaving you $18,253. Long-term gains get preferential 0%, 15% or 20% rates based on your total income. Figures use 2025 federal rules.

Recommendation$1,805 less than short-term

Holding long-term saved you $1,805

If you'd sold this at a short-term gain (held one year or less), it would be taxed as ordinary income — about $3,553 instead of $1,748 in federal tax. The one-year holding line is one of the highest-value dates in investing: crossing it can cut the tax on a gain by more than half.

Opportunity

You have $8,350 of 0% capital gains space

Long-term gains are taxed at 0% until your total income reaches $48,350. With $40,000 of other income, roughly $8,350 of this gain falls in the 0% band. In lower-income years — early retirement, a gap year, a sabbatical — deliberately realizing gains up to this threshold can reset your cost basis entirely tax-free.

$150,000 gain triggering the NIIT

A large sale that pushes total income past the Net Investment Income Tax threshold, adding the 3.8% surtax.

Capital gains tax

$27,440

Capital gain
$150,000
Federal tax on gain
$22,500
Net Investment Income Tax
$4,940
Effective rate
18.3%
After-tax gain
$122,560
If sold short-term
$49,000
Summary

You'd owe about $27,440 on a $150,000 long-term gain

That's an effective rate of 18.3% on the gain, leaving you $122,560. Long-term gains get preferential 0%, 15% or 20% rates based on your total income. Figures use 2025 federal rules, including the 3.8% Net Investment Income Tax.

Recommendation$26,500 less than short-term

Holding long-term saved you $26,500

If you'd sold this at a short-term gain (held one year or less), it would be taxed as ordinary income — about $49,000 instead of $22,500 in federal tax. The one-year holding line is one of the highest-value dates in investing: crossing it can cut the tax on a gain by more than half.

Watch out

The 3.8% Net Investment Income Tax adds $4,940

Because your income plus this gain ($330,000) exceeds the $200,000 threshold for your filing status, $130,000 of the gain is subject to the additional 3.8% NIIT on top of the regular capital gains rate. This surtax catches many people by surprise in a year with a large sale.

The basics

Short-term vs long-term: the one-year line

How long you hold an asset before selling determines how the profit is taxed. Sell after holding one year or less and the gain is short-term, taxed as ordinary income at your regular marginal rate — up to 37% federally. Hold for more than a year and it becomes long-term, taxed at the preferential 0%, 15% or 20% rates.

That difference is large. For many investors, crossing the one-year mark cuts the tax on a gain by more than half. It's why the holding period is one of the most important — and most overlooked — dates in taxable investing.

  • Short-term (≤1 year): taxed as ordinary income, up to 37%
  • Long-term (>1 year): taxed at 0%, 15% or 20% based on total income
  • The 2025 long-term 0% band reaches up to $48,350 of income for single filers
  • The holding period counts from the day after purchase to the sale date

Going deeper

The 0% bracket and the NIIT surtax

Long-term capital gains have a genuine 0% bracket. If your total taxable income — including the gain — stays under the first threshold, that portion of the gain is taxed at nothing. In low-income years, deliberately selling appreciated assets up to this line resets your cost basis entirely tax-free, a strategy known as gain harvesting.

At the other end, high earners face an extra layer: the Net Investment Income Tax adds 3.8% on investment income once modified adjusted gross income passes $200,000 (single) or $250,000 (married). It stacks on top of the regular capital gains rate, so a top-bracket long-term gain can effectively be taxed at 23.8% federally before any state tax.

Offsetting gains with losses

Capital losses are valuable. They offset capital gains dollar-for-dollar, and if losses exceed gains, up to $3,000 of the excess can reduce your ordinary income each year, with the rest carrying forward indefinitely. Selling losing positions to offset winners — tax-loss harvesting — is a standard year-end move.

The main pitfall is the wash-sale rule: if you buy the same or a substantially identical security within 30 days before or after the sale, the loss is disallowed. Investors usually work around it by buying a similar-but-not-identical fund to stay invested while preserving the deductible loss.

Common mistakes

  1. 1

    Selling just before the one-year mark

    Selling at 11 months turns a long-term gain into a short-term one taxed as ordinary income. If you're close, waiting a few weeks can cut the tax by more than half.

  2. 2

    Forgetting the 3.8% NIIT on large sales

    A big gain can push income past the NIIT threshold, adding 3.8% on top of the capital gains rate. Model the surtax before selling.

  3. 3

    Ignoring the 0% bracket in low-income years

    In a gap year or early retirement, gains up to the threshold can be realized tax-free. Missing that window leaves a valuable, legal reset on the table.

  4. 4

    Triggering a wash sale

    Rebuying the same security within 30 days of selling for a loss disallows the deduction. Use a similar-but-different fund to stay invested.

  5. 5

    Overlooking state tax

    Most states tax gains as ordinary income with no long-term break. The federal estimate alone understates the total in high-tax states.

Common questions

How much is capital gains tax?

It depends on how long you held the asset and your income. Long-term gains (held over a year) are taxed at 0%, 15% or 20% federally. Short-term gains (a year or less) are taxed as ordinary income, up to 37%. High earners may also owe the 3.8% Net Investment Income Tax. Enter your numbers above for a specific estimate using 2025 federal rates.

What is the difference between short-term and long-term capital gains?

It's the holding period. Sell an asset after owning it a year or less and the profit is a short-term gain, taxed at your ordinary income rate. Hold it more than a year and it's a long-term gain, taxed at lower preferential rates. The distinction can cut the tax on a gain by more than half, which is why holding past the one-year mark often matters.

What is the 0% capital gains bracket?

Long-term capital gains are taxed at 0% until your total taxable income — including the gain — reaches a threshold ($48,350 for single filers in 2025). Gains that fall within that band are federally tax-free. In low-income years, some investors deliberately realize gains up to the threshold to reset their cost basis at no tax cost.

What is the Net Investment Income Tax?

The NIIT is an additional 3.8% federal tax on investment income — including capital gains — for taxpayers whose modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly). It stacks on top of the regular capital gains rate, so a large sale can push you over the threshold and add the surtax unexpectedly.

Do I pay state tax on capital gains too?

Usually yes. Most states tax capital gains as ordinary income, with no preferential long-term rate, though a handful — including Texas, Florida and Washington (for most gains) — have no state income tax. This calculator estimates federal tax only; add your state's rate for the full picture.

How can I reduce capital gains tax?

Common strategies include holding assets over a year for long-term rates, harvesting losses to offset gains, realizing gains in low-income years within the 0% bracket, donating appreciated assets to charity, and holding investments in tax-advantaged accounts like an IRA or 401(k) where gains aren't taxed as they accrue.

Glossary

Cost basis
What you originally paid for an asset, including commissions. The gain is the sale price minus this figure.
Long-term gain
Profit on an asset held more than one year, taxed at preferential 0/15/20% federal rates.
Short-term gain
Profit on an asset held one year or less, taxed as ordinary income at your marginal rate.
NIIT
Net Investment Income Tax — a 3.8% surtax on investment income above $200k single / $250k married MAGI.
Tax-loss harvesting
Selling losing positions to offset gains and reduce taxes, subject to the wash-sale rule.
Wash sale
Rebuying the same or substantially identical security within 30 days of a loss sale, which disallows the loss.

Related tools

The next calculations that usually follow this one.

Read next

Guides that explain the decisions behind these numbers.

  • beginner9 min read

    Understanding US Taxes

    How US federal tax brackets work, the difference between marginal and effective rates, and the deductions and accounts that actually reduce your bill.

    Updated January 15, 2026

  • beginner11 min read

    Investing for Beginners

    A beginner's guide to investing in the US: account order, index funds, fees, asset allocation and the behavioral mistakes that cost the most.

    Updated January 15, 2026

More in taxes

One useful money idea a week

New tools, guides and the occasional thing that will genuinely save you money. No spam, unsubscribe anytime.

Developer note: this form has no backend. Connect an email provider and add a privacy policy before collecting real addresses.