US Capital Gains Tax Calculator (2025)

Help US taxpayers estimate the federal tax owed on a capital gain from selling stocks, crypto, property or other assets, accounting for holding period, filing status, how the gain stacks on top of other taxable income, and the 3.8% Net Investment Income Tax.

Enter your details

Your net profit on the asset: sale price minus cost basis (what you paid plus qualifying costs). Enter the gain only, not the full sale price.
Long-term gains (held more than one year) get preferential 0/15/20% rates. Short-term gains are taxed as ordinary income.
Your 2025 federal filing status. This sets the income thresholds for each capital gains rate.
Your taxable income before adding this gain (wages, business and other income after deductions such as the standard deduction). Long-term gains stack on top of this amount to decide your rate.

Result

Fill in the fields and press Calculate.

Worked example

Scenario: A single filer has $40,000 of other taxable income (after deductions) and sells stock held for three years for a $20,000 long-term gain.

  1. Holding period: more than one year, so the 0/15/20% long-term rates apply.
  2. Stack the gain: the $20,000 gain sits on top of $40,000, filling the range from $40,000 to $60,000 of taxable income.
  3. 0% band: the single 0% threshold is $48,350. The portion of the gain from $40,000 to $48,350, which is $8,350, is taxed at 0% = $0.
  4. 15% band: the remaining gain from $48,350 to $60,000, which is $11,650, is below the $533,400 threshold and taxed at 15% = $1,747.50.
  5. 20% band: none of the gain reaches $533,400, so nothing is taxed at 20%.
  6. NIIT: MAGI is about $60,000, below the $200,000 single threshold, so no 3.8% tax applies.

Estimated federal capital gains tax: $1,747.50 on the $20,000 gain (an effective rate of about 8.7%). For comparison, if the same gain were short-term, it would be added to ordinary income and split across the 12% and 22% brackets: $8,475 at 12% ($1,017) plus $11,525 at 22% ($2,535.50), for roughly $3,553.

How long-term capital gains stack on top of your income

Long-term capital gains, from assets you held more than one year, are not taxed in isolation. They sit on top of your ordinary taxable income and are taxed at 0%, 15% or 20% depending on where that combined total lands. This stacking rule is the single most misunderstood part of capital gains tax, and it is why two people with the same gain can owe very different amounts.

For 2025, a single filer pays 0% on long-term gains while taxable income stays at or below $48,350, 15% on income from there up to $533,400, and 20% above that. Married couples filing jointly get a 0% band up to $96,700, 15% up to $600,050, and 20% beyond. Head of household thresholds are $64,750 and $566,700, and married filing separately are $48,350 and $300,000.

The key is that your other income fills the lower brackets first. Suppose you are single with $30,000 of taxable income and a $30,000 long-term gain. Your other income uses the space from $0 to $30,000. The gain then fills $30,000 to $60,000. The first $18,350 of the gain (up to the $48,350 threshold) is taxed at 0%, and only the remaining $11,650 is taxed at 15%. A single band can be split across two rates, which is exactly what this calculator models.

This design creates a genuine 0% opportunity. Retirees, people between jobs, or anyone in a low-income year can realize gains and pay nothing federally, as long as their total taxable income stays under the 0% ceiling. Because the gain itself counts toward that ceiling, the room available shrinks as you sell, so large gains often straddle the 0% and 15% bands. The calculator applies each rate to the exact slice of the gain that falls in each band, rather than taxing the whole gain at one rate, which is how the IRS worksheet actually works.

Note that these thresholds are based on taxable income, meaning income after the standard or itemized deduction. Enter the income figure from the taxable income line of your return, not your gross wages, so the bands line up correctly.

Short-term gains, holding period, and why one year matters

The holding period is the difference between a preferential tax rate and your full ordinary rate. An asset held for one year or less produces a short-term capital gain, taxed as ordinary income at rates up to 37% for 2025. An asset held for more than one year produces a long-term gain taxed at 0%, 15% or 20%. On a large gain that gap can easily be worth thousands of dollars.

Counting the period correctly matters. The holding period begins the day after you acquire the asset and includes the day you sell it. If you bought stock on March 10, 2024, you must sell on or after March 11, 2025 to qualify as long-term. Selling on March 10, 2025 is exactly one year and still counts as short-term. For inherited assets the rules are more generous: they are automatically treated as long-term regardless of how long you actually held them.

Short-term gains do not have their own rate schedule. They are simply added to your wages and other income and taxed at whatever marginal brackets they push you into. That is why this calculator, for a short-term gain, layers the gain on top of your other taxable income and measures the extra ordinary tax it creates. A gain that starts in the 22% bracket and spills into the 24% bracket is taxed partly at each rate.

This ordinary treatment has a knock-on effect: a short-term gain can raise your adjusted gross income enough to affect other items, such as eligibility for credits, the taxation of Social Security, or Medicare premium surcharges. It can also push you over the Net Investment Income Tax threshold. If you are close to the one-year mark, waiting a few extra days to cross into long-term territory is one of the highest-return decisions available to an investor, because the rate can drop from as high as 37% to as low as 0%.

Short-term and long-term transactions are also netted separately on Schedule D. Short-term losses first offset short-term gains, and long-term losses offset long-term gains, before the two categories are combined. This calculator estimates the tax on a single net gain you have already computed.

The 3.8% Net Investment Income Tax (NIIT)

High earners face an extra layer on top of the headline capital gains rate: the 3.8% Net Investment Income Tax. Enacted to help fund Medicare, it applies to investment income, including capital gains, interest, dividends and rental income, once your modified adjusted gross income (MAGI) crosses a fixed threshold.

For 2025 the MAGI thresholds are $200,000 for single and head of household filers, $250,000 for married filing jointly, and $125,000 for married filing separately. Unlike the capital gains brackets, these thresholds are set by statute and are not adjusted for inflation, so more taxpayers drift into NIIT range each year as incomes rise.

The tax is 3.8% of the lesser of two amounts: your net investment income, or the amount by which your MAGI exceeds the threshold. This two-part test matters. If a single filer has $220,000 of MAGI that includes a $50,000 gain, the excess over the threshold is only $20,000, so NIIT applies to $20,000, not the full $50,000, for an extra tax of $760. If instead their MAGI were $300,000, the full $50,000 gain would be hit, adding $1,900.

Because NIIT stacks on top of the capital gains rate, a long-term gain that is otherwise taxed at 20% can face a combined federal rate of 23.8%, and a short-term gain in the top bracket can reach 40.8%. This calculator adds the NIIT automatically when your MAGI, including the gain, clears your filing-status threshold, using the lesser-of rule so the estimate is not overstated.

Wages and self-employment income are exempt from NIIT, since they are subject to separate Medicare taxes instead, and so are unemployment compensation, Social Security benefits, alimony, tax-exempt interest, operating income from a nonpassive business, and distributions from qualified retirement plans such as a 401(k), 403(b) or IRA. Capital gains, however, are squarely within its reach. Planning techniques that keep MAGI below the threshold, such as spreading a large sale across two tax years or harvesting losses, can remove the 3.8% surcharge entirely even when the underlying capital gains rate does not change.

Ways to reduce your capital gains tax

Because the tax depends on holding period, income level and timing, several legitimate strategies can lower the bill. This calculator is a good place to test each one by changing the inputs and comparing results.

Hold for more than a year. The simplest move is to cross the one-year line so a gain qualifies for long-term rates. Converting a 22% short-term rate into a 15% long-term rate, or even 0%, is often worth waiting a few extra days.

Use the 0% bracket in low-income years. If your total taxable income including a gain stays under the 0% ceiling ($48,350 single or $96,700 married filing jointly for 2025), the gain is federally tax-free. Realizing gains deliberately in a gap year, early retirement, or a sabbatical can reset your cost basis at no tax cost.

Harvest losses. Capital losses offset capital gains dollar for dollar, and up to $3,000 of net loss can offset ordinary income each year, with the remainder carried forward. Selling a losing position in the same year as a large gain can neutralize much of the tax. Watch the wash-sale rule, which disallows the loss if you rebuy substantially identical securities within 30 days.

Spread large sales across years. Splitting a sale between December and January can keep MAGI under the NIIT threshold and prevent part of the gain from being pushed into the 20% band, since both depend on total income within a single tax year.

Use tax-advantaged accounts. Gains inside an IRA, 401(k) or Roth account are not taxed as they occur, so active rebalancing there avoids capital gains entirely. Roth withdrawals in retirement are tax-free.

Consider the primary-residence exclusion. If the asset is your main home, you may exclude up to $250,000 of gain (single) or $500,000 (married filing jointly) if you owned and lived in it for two of the last five years, before any capital gains tax applies.

Hold until death for a step-up. Heirs generally receive assets at their fair market value at the date of death, erasing the built-in gain. This calculator estimates federal tax only; state capital gains tax, where your state imposes one, is additional and can add several percentage points.

Frequently asked questions

What are the 2025 long-term capital gains tax rates?

For 2025, long-term gains are taxed at 0%, 15% or 20%. A single filer pays 0% on taxable income up to $48,350, 15% from there to $533,400, and 20% above that. For married filing jointly the bands are $96,700 and $600,050; for head of household, $64,750 and $566,700; for married filing separately, $48,350 and $300,000. High earners may also owe the 3.8% NIIT on top.

How is the difference between short-term and long-term taxed?

An asset held one year or less produces a short-term gain taxed as ordinary income, at rates up to 37% for 2025. An asset held more than one year gets long-term rates of 0%, 15% or 20%. On a $20,000 gain, a taxpayer in the 24% ordinary bracket would owe about $4,800 short-term versus $3,000 at the 15% long-term rate, a $1,800 difference for holding a bit longer.

What is the 3.8% Net Investment Income Tax and will I owe it?

The NIIT is an extra 3.8% on investment income, including capital gains, once your modified adjusted gross income exceeds $200,000 (single or head of household), $250,000 (married filing jointly) or $125,000 (married filing separately) for 2025. It applies to the lesser of your net investment income or the amount your MAGI exceeds the threshold, so a gain that only partly clears the threshold is only partly taxed.

Can I really pay 0% tax on capital gains?

Yes. If your total taxable income including the long-term gain stays at or below the 0% threshold ($48,350 single or $96,700 married filing jointly for 2025), the gain is taxed at 0% federally. Because the gain counts toward that threshold, a large gain often straddles the 0% and 15% bands, with only the portion above the ceiling taxed at 15%.

How do I calculate my cost basis and gain?

Your gain is the sale price minus your cost basis. Cost basis is what you paid for the asset plus commissions, fees and qualifying improvements. For a home, add the cost of capital improvements. For reinvested dividends, add each reinvestment to basis. Enter only the net gain, not the full sale proceeds, into the calculator.

Does this calculator include state capital gains tax?

No. It estimates federal tax only: the 0/15/20% long-term rates or ordinary short-term rates, plus the 3.8% NIIT where applicable. Most states tax capital gains as ordinary income, and a few have no income tax at all, so your total bill may be higher depending on where you live. Check your state's rules separately.