Skip to content
Popular Calculators
Browse Finance calculators

US Capital Gains Tax Calculator

Federal tax on a gain, with the 0/15/20 bands stacked the way they really work — and the room left in the 0% band, which is the number worth acting on.

Sale price less what you paid and the costs of buying and selling.

Taxable income after the standard or itemised deduction, excluding this gain. It decides which bands the gain reaches.

More than a year gets the 0/15/20 rates. A year or less is taxed as ordinary income.

Sets the default band thresholds below.

2025 figure for a single filer. Measured in total taxable income including the gain.

Above this the rate is 20%. Also measured in total taxable income.

MAGI above which the net investment income tax applies. 200,000 single, 250,000 married.

Charged on the lesser of your investment income and the amount your MAGI exceeds the threshold.

About the US Capital Gains Tax Calculator

Federal tax on the profit from selling an asset — shares, a second property, a business, crypto.

Two beliefs about it are extremely common, and both make the 0% rate sound more generous than it is:

"I'm in the 0% bracket, so my gain is tax free."

"Selling will push my salary into a higher bracket."

The first is usually wrong. The second is always wrong. This US capital gains tax calculator works both out by stacking the gain the way the rules actually stack it, rather than applying a single rate to the whole thing.

How to Use the US Capital Gains Tax Calculator

Enter the gain — the sale price less what you paid and the costs of buying and selling.

Enter your other taxable income, after deductions. This is the input people skip, and it is the one that decides everything: the bands are thresholds on total taxable income, so what you already earn determines which bands the gain reaches.

Set how long you held it. More than a year gets the 0/15/20 rates; a year or less is taxed as ordinary income.

The band thresholds and the surtax default to 2025 figures and are editable, because they move every year.

Step-by-Step Example

A $50,000 long-term gain, on top of $40,000 of other taxable income, single.

  Ordinary taxable income:            40,000
  Room left under the 48,350 threshold: 8,350

  8,350 of the gain   at 0%   =         0
  41,650 of the gain  at 15%  =     6,247.50
                                  ──────────
  Tax:                              6,247.50
  Kept:                            43,752.50

Effective rate on the gain: 12.5%. Marginal rate: 15%.

Not 0%, despite $40,000 of income sitting inside what people call the 0% bracket. And not 15% either.

The Gain Is Stacked On Top

This is the whole mechanic, and it explains both misconceptions at once.

Ordinary income fills the bands from the bottom. The capital gain sits on top of it. So:

The gain moves itself through the bands as you realise it. Only the part that lands below the 0% threshold is free. A large gain cannot sit entirely in the 0% band however low your other income is, because the gain itself counts toward the threshold.

But the gain never changes the tax on the income underneath. Ordinary income was stacked first and is already settled. Selling an asset cannot raise the tax on your salary — the stacking runs the other way, and the fear has it backwards.

How Much Can You Realise at 0%?

This is the number worth acting on, and the calculator reports it directly.

The room left is the top of the 0% band, less your other taxable income, less any gain you have already realised. With $20,000 of income and a $10,000 gain realised, there is $18,350 of room remaining.

Realising a gain inside that room costs nothing. Letting it accumulate into a later year, when your income may be higher or the position larger, can mean paying 15% on the very same gain. For anyone with a low-income year — a career break, early retirement before pensions start, a business loss — this is genuinely free money, and it expires annually.

The 3.8% Surtax Is a Separate Layer

Once modified adjusted gross income passes $200,000 single or $250,000 married, investment income picks up an extra 3.8%.

Headline rateWith the surtax
15%18.8%
20%23.8%

One detail that is routinely got wrong: the surtax is charged on the lesser of your investment income and the amount your MAGI exceeds the threshold. A $100,000 gain that takes MAGI to $280,000 is only surtaxed on $80,000, not on the full gain. Near the boundary, only part of the gain is exposed — which is why the effective rate in that example is 18.04% rather than 18.8%.

Short-Term Gains Are Just Income

Hold for a year or less and there is no capital gains rate at all. The gain is added to ordinary income and taxed at your ordinary brackets.

On $100,000 of other taxable income, a $50,000 gain costs $11,933 as a short-term gain against $7,500 at the long-term rate. A difference of $4,433, decided entirely by the calendar.

The holding period runs from the day after you bought to the day you sold. On a position close to the line, that distinction is worth checking against the trade confirmations rather than from memory.

Nothing Here Is a Cliff

Worth stating plainly, because tax systems do contain cliffs and people reasonably worry about them.

Every band in the capital gains rules is marginal. More gain always leaves more after tax. The calculator sweeps every gain up to $900,000 at four different income levels in its own test suite and confirms after-tax proceeds never fall, and that the marginal rate never exceeds 23.8%.

So there is no threshold you should avoid crossing. There are only thresholds worth timing — which is a different decision, and the one the 0% headroom figure is for.

Understanding Your Result

After tax is what you keep from the gain.

Tax due separates the capital gains tax from any surtax.

How the gain was taxed shows the amount falling into each band, which is what makes the stacking visible.

Effective and marginal gives the rate across the whole gain and the rate on the next dollar of it. They differ, and the marginal one governs any decision about selling more.

Worth knowing flags the 0% headroom, the band the gain pushed itself out of, or the surtax.

When Should You Use This Calculator?

Before selling. Particularly to see how much falls at 0%.

In a low-income year. The 0% headroom is largest exactly when your income is smallest, and it does not carry forward.

Deciding whether to wait for the one-year mark. The difference is often thousands.

Planning a large sale. Splitting a sale across two tax years can keep more of it in lower bands.

Common Mistakes

Assuming the 0% bracket covers the whole gain. The gain counts toward the threshold that decides its own rate.

Fearing that a sale will raise the tax on your salary. It cannot. Ordinary income is stacked first.

Applying one rate to the whole gain. A gain that straddles a threshold is taxed in parts.

Forgetting the 3.8% surtax. It turns 15% into 18.8% and 20% into 23.8%.

Charging the surtax on the whole gain. It applies to the lesser of the gain and the MAGI excess.

Ignoring state tax. Several states tax capital gains as ordinary income, and none of that is included here.

Letting the 0% room expire. It resets annually and cannot be carried forward.

Thresholds change every tax year, state tax is not included, and the treatment of losses, wash sales, inherited assets and primary residences all sit outside this calculation. Every figure here is an estimate for planning, not tax advice.

Frequently Asked Questions

If I am in the 0% capital gains bracket, is my whole gain tax free?

Usually not. The 0/15/20 thresholds apply to total taxable income including the gain, and the gain is stacked on top of your other income — so the gain moves you through the bands as you realise it. With 40,000 of ordinary taxable income and a 50,000 gain, only 8,350 lands under the 48,350 threshold and is free; the other 41,650 is taxed at 15%. The gain pushes itself out of its own bracket.

Will selling push my salary into a higher tax bracket?

No. Ordinary income is stacked first and long-term gains sit on top of it, so realising a gain never changes the tax on the income underneath. The causation only runs the other way: your ordinary income determines which capital gains bands the gain reaches. The common fear has the stacking backwards.

How much can I realise at 0%?

The room left is the top of the 0% band less your other taxable income and any gain already realised. The calculator reports it directly. It is worth acting on deliberately — realising gains up to that figure costs nothing, whereas letting them accumulate into a later year can mean paying 15% on the same gain.

What is the 3.8% net investment income tax?

A surtax on investment income once modified adjusted gross income passes 200,000 single or 250,000 married. It turns a 15% rate into 18.8% and a 20% rate into 23.8%. It is charged on the lesser of your net investment income and the amount your MAGI exceeds the threshold, so near the boundary only part of the gain is exposed — a 100,000 gain taking MAGI to 280,000 is only surtaxed on 80,000.

How much does holding for a year actually save?

It depends on your income, and it is often large. A 50,000 gain on top of 100,000 of ordinary taxable income costs 11,933 as a short-term gain taxed at ordinary rates, against 7,500 at the long-term rate — a difference of 4,433. The holding period runs from the day after you bought to the day you sold.

Is there any point where realising more gain leaves me worse off?

No. Every band in the capital gains rules is marginal, so more gain always leaves more after tax. The calculator sweeps every gain up to 900,000 at several income levels in its own tests and confirms after-tax proceeds never fall, and that the marginal rate never exceeds 23.8%.

Last reviewed September 24, 2026 by the CalculatorPeak editorial team.