Answer · Internal Revenue Code

How does federal capital gains tax work?

Everything the federal government charges on a capital gain in 2026 — the rate ladder, the two special rate groups, the 3.8% surtax and the netting rules — and where states begin.

Tax year 2026 figures. Last updated .

Four separate federal charges

People speak of "the capital gains tax" as one thing. Federally it is four, and they stack in a defined order.

There is the 0/15/20 ladder on ordinary long-term gains. There is a 25% cap on the portion of a real-estate gain attributable to depreciation. There is a 28% cap on collectibles. And there is the 3.8% net investment income tax, a separate charge under a different chapter of the code, riding on top of any of them.

Short-term gains sit outside all four, on the ordinary income table.

The ladder, and what it is measured against

Long-term gains are taxed at 0%, 15% or 20%, chosen by total taxable income with the gain included. For 2026 a single filer holds 0% to $49,450 and 15% to $545,500; joint filers to $98,900 and $613,700.

The gain is stacked above ordinary income rather than taxed independently, so one gain can occupy two rungs at once. The ordering is set by IRC § 1(h) and is not discretionary.

Unrecaptured section 1250 gain

If you claimed depreciation on a rental or other depreciable property, that depreciation reduced your basis while you held it — and on sale the corresponding slice of gain is taxed at up to 25% rather than at the preferential rates.

Two details matter. The amount recaptured is the lesser of depreciation taken and total gain, so it can never exceed what you actually made. And 25% is a maximum, not a flat rate: a taxpayer whose ordinary rate is lower pays the lower rate. Calculators that apply a flat 25% overstate the bill for modest earners.

Collectibles at 28%

Art, coins, precious metals, wine and similar tangible assets are capped at 28% rather than 20%. Again a maximum rather than a flat rate.

This is one of the few places where federal treatment is less favourable than for ordinary investments, and it is easy to miss when a collection is sold alongside a securities portfolio.

The 3.8% net investment income tax

Enacted under IRC § 1411 and effective since 2013, this charges 3.8% on the lesser of net investment income and the amount by which modified AGI exceeds $200,000 single or $250,000 joint.

Two things are commonly got wrong. The "lesser of" test means a filer barely over the threshold pays the surtax on a small amount, not on the whole gain. And the base is modified AGI, a pre-deduction figure — not the taxable income the rate ladder uses. The thresholds have never been indexed, so their reach grows every year.

Netting and losses

Before any of the above, gains and losses are netted: short against short, long against long, then across. Remaining net losses offset up to $3,000 of ordinary income a year, with the excess carried forward indefinitely and retaining its character.

The $3,000 figure is statutory and has not moved since 1978, which makes it one of the least generous provisions in the code in real terms.

Where federal ends and state begins

Everything above is federal. Most states then tax the same gain again as ordinary income on their own ladder, computed on their own definition of taxable income with their own additions and subtractions.

Eight states levy no individual income tax on gains at all. Washington charges a separate 7% excise tax on long-term gains despite having no income tax. Arizona subtracts 25% of long-term gain for assets acquired after 2011. Massachusetts taxes in classes rather than on a ladder. The state comparison sets out each of the covered states side by side.

Qualified dividends are taxed with capital gains

Not a capital gain, but taxed on the same ladder. Qualified dividends join the adjusted net capital gain and use the same 0/15/20 ceilings, subject to a holding period test around the ex-dividend date.

This matters for stacking. Dividends received during the year consume ceiling room before a later sale reaches it, so a portfolio generating substantial qualified dividend income can push a gain into a higher band without any decision being made about the gain itself.

What the federal layer does not charge

There is no federal wealth tax on unrealised appreciation. Holding an asset that has risen in value creates no liability, however large the paper gain — the tax is triggered by disposal, which is why timing is the lever it is.

There is no federal transaction tax on securities sales. There is no separate federal real estate transfer tax, though states and localities often levy one.

And there is no additional Medicare tax on capital gains beyond the 3.8% net investment income tax, which is often confused with the 0.9% Additional Medicare Tax — a different charge that applies to wages and self-employment income, not to gains.

Small business stock, and other special regimes

A few categories of asset have their own federal rules that sit outside the ordinary treatment described above, and it is worth knowing they exist even though this calculator does not model them.

Qualified small business stock under section 1202 can attract a substantial exclusion when held for the required period, with the portion that remains taxable falling into the 28% rate group rather than the 0/15/20 ladder. The qualification tests are demanding and turn on facts about the issuing company, not just about your holding.

Section 1256 contracts — regulated futures, certain options — are marked to market at year end and taxed on a fixed 60/40 split between long-term and short-term regardless of actual holding period.

Instalment sales under section 453 spread gain recognition across the years payments are received, which changes the timing rather than the total.

Each of these changes the answer materially where it applies. The calculator computes the ordinary case and the methodology page states the full scope, because a figure produced by ignoring a regime that applies to you is worse than no figure.

How the federal figure interacts with your state

The two layers are computed independently, which surprises people who expect the state to work from the federal answer.

Most states begin from federal adjusted gross income or federal taxable income, then apply their own additions and subtractions to reach a state taxable income that is genuinely different. They then apply their own rates to it. So the state bill is not a percentage of the federal one, and the two can move in different directions.

The preferential federal treatment usually does not carry across. A long-term gain taxed at 15% federally is generally taxed at your full state ordinary rate, because most states make no distinction between gains and other income. That is why a state figure can look disproportionate next to the federal one on a long-held asset.

There is also no federal deduction for state income tax paid on a gain beyond the general state and local tax deduction, which is capped. The state comparison sets out what each covered state does.

The alternative minimum tax, briefly

The AMT is a parallel calculation that disallows certain deductions and preferences, and pays whichever result is higher. Long-term capital gains keep their preferential rates under it, so a gain does not itself create AMT exposure the way some other items do.

It can still matter indirectly: a large gain raises income, which phases out the AMT exemption, which can pull a filer into AMT for other reasons entirely.

This calculator does not compute the AMT. For most filers with a straightforward gain it does not bind, but it is one of the reasons a large or unusual year is worth taking to a professional.

Worked example

Computed by the same engine that powers the calculator, at the moment this page was built — not typed in by hand. Open the derivation to see every rule and citation.

A gain that touches three of the four federal charges

A single filer with $210,000 of wages sells a rental property held eight years: $400,000 of gain, of which $90,000 corresponds to depreciation claimed.

Taxable income after deduction
$593,900
Taxable gain
$400,000
Tax owed without the sale
$39,134
Tax the sale added
$86,541.25
of which net investment income tax
$15,200
Total federal tax
$125,675.25
Effective rate on the gain
21.64%

The derivation splits this into unrecaptured section 1250 gain at up to 25%, the residual long-term gain on the ladder, and the 3.8% surtax on top. One sale, three different federal rates.

Caveats on this example (1)
  • Net investment income was derived from capital gains and qualified dividends only. Interest, non-qualified dividends, rents, royalties and passive business income inside ordinaryIncome are also net investment income under IRC 1411(c) and are not counted here.
Show the working — 20 steps, each with its citation
  1. Gain on sale of depreciable real property$400,000Amount realized less adjusted basisIRC 1001; IRS Pub. 544

    $700,000 amount realized less $300,000 adjusted basis, which is already net of depreciation taken.

  2. Depreciation allowed or allowable$90,000Unrecaptured Section 1250 gainIRC 1(h)(1)(E), 1(h)(6); IRS Pub. 544

    Straight-line depreciation taken over the holding period. "Allowed or allowable" means depreciation the taxpayer could have claimed counts even if it was not claimed.

  3. Unrecaptured Section 1250 gain$90,000Unrecaptured Section 1250 gain capIRC 1(h)(1)(E), 1(h)(6); IRS Pub. 544

    The lesser of $90,000 of depreciation and $400,000 of total gain. Taxed at up to 25%.

  4. Remaining long-term gain above depreciation$310,000Unrecaptured Section 1250 gainIRC 1(h)(1)(E), 1(h)(6); IRS Pub. 544

    Appreciation beyond the depreciation taken, eligible for the 0/15/20% rates.

  5. Net short-term capital gain or loss for the year$0Short-term / long-term nettingIRC 1222; IRS Pub. 550

    Assets held one year or less. Taxed at ordinary rates if a net gain.

  6. Net long-term capital gain or loss for the year$400,000Short-term / long-term nettingIRC 1222; IRS Pub. 550

    Assets held more than one year. Eligible for the 0/15/20% rates.

  7. Standard deduction-$16,100Deduction from adjusted gross incomeRev. Proc. 2025-32 4.14(1) (IRC 63(c)(2))

    Adjusted gross income of $610,000 less $16,100.

  8. Taxable income$593,900Taxable incomeIRC 63(a)

    The figure the rate tables and the capital gain ceilings are both measured against.

  9. Ordinary income taxed at 10%$1,240Ordinary income tax bracketsRev. Proc. 2025-32 4.01 (IRC 1(j)(2))

    $12,400 of taxable income between $0 and $12,400.

  10. Ordinary income taxed at 12%$4,560Ordinary income tax bracketsRev. Proc. 2025-32 4.01 (IRC 1(j)(2))

    $38,000 of taxable income between $12,400 and $50,400.

  11. Ordinary income taxed at 22%$12,166Ordinary income tax bracketsRev. Proc. 2025-32 4.01 (IRC 1(j)(2))

    $55,300 of taxable income between $50,400 and $105,700.

  12. Ordinary income taxed at 24%$21,168Ordinary income tax bracketsRev. Proc. 2025-32 4.01 (IRC 1(j)(2))

    $88,200 of taxable income between $105,700 and $193,900.

  13. Unrecaptured Section 1250 gain taxed at 24%$1,890Unrecaptured Section 1250 gain maximum rateIRC 1(h)(1)(E), 1(h)(6); IRS Pub. 544

    $7,875 at the 24% ordinary rate, which is below the 25% maximum.

  14. Unrecaptured Section 1250 gain taxed at 25%$20,531.25Unrecaptured Section 1250 gain maximum rateIRC 1(h)(1)(E), 1(h)(6); IRS Pub. 544

    $82,125 at the 25% maximum rate.

  15. Ordinary income stacked below the long-term gain$283,900LTCG bracket stackingIRC 1(h); Schedule D Tax Worksheet, Form 1040 instructions

    Long-term gain is taxed by reference to where it sits ON TOP of $283,900 of other taxable income, not from the bottom of the rate table.

  16. Long-term gain taxed at 15%$39,240LTCG bracket stackingRev. Proc. 2025-32 4.03 (IRC 1(h), 1(j)(5))

    Gain between the $49,450 zero-rate ceiling and the $545,500 15% ceiling.

  17. Long-term gain taxed at 20%$9,680LTCG bracket stackingRev. Proc. 2025-32 4.03 (IRC 1(h), 1(j)(5))

    Gain above the $545,500 maximum 15% rate amount.

  18. Net investment income tax threshold$200,000IRC 1411 thresholdIRC 1411(a)-(b); 26 C.F.R. 1.1411-2

    Modified AGI of $610,000 against the $200,000 threshold for a single filer. This threshold is statutory and is not adjusted for inflation.

  19. Net investment income tax at 3.8%$15,200Net investment income taxIRC 1411(a)-(b); 26 C.F.R. 1.1411-2

    3.8% of $400,000, the lesser of net investment income ($400,000) and the amount by which modified AGI exceeds the threshold ($410,000). Here the binding figure is net investment income.

  20. Total tax$125,675.25Sum of all tax stepsRev. Proc. 2025-32 (I.R.B. 2025-45)

    $125,675.25 on $610,000 of total income, an effective rate of 20.6%.

Run your own figures

Nothing you enter leaves your browser. The calculation runs locally and no values are transmitted or stored on a server — see the privacy page.

You
The sale
State

Related questions

How does capital gains tax work?

Your long-term gain is stacked on top of your other taxable income, not taxed from the bottom of the rate table. Ordinary income fills the lower brackets first and the gain sits above it, so the rate you pay on the gain depends on how much other income is underneath it. One consequence surprises people: a single gain can straddle two bands, with part taxed at 15% and the remainder at 20%. The calculator shows that split rather than averaging it away.

Do I have to pay the 3.8% net investment income tax as well?

Only if your modified adjusted gross income exceeds $200,000 filing single or $250,000 jointly, and then only on the lesser of your net investment income and the amount by which you exceed the threshold. That “lesser of” matters: a taxpayer $10,000 over the threshold with a $400,000 gain pays 3.8% on $10,000, not on $400,000. The thresholds are fixed in statute and have never been indexed for inflation, so they capture more filers each year.

Why do I owe 25% on the sale of a rental property?

Because depreciation you claimed while letting the property reduced your basis, and on sale that portion of the gain is recaptured as unrecaptured section 1250 gain. The 25% is a maximum, not a flat rate — if your ordinary rate is lower, the lower rate applies. The recaptured amount is the lesser of the depreciation taken and the total gain, so it can never exceed what you actually made on the sale.

Can I offset capital gains with capital losses?

Yes, and the netting order is fixed: short-term losses against short-term gains and long-term against long-term first, then any remaining loss of one character offsets the other. If losses still exceed gains, up to $3,000 a year offsets ordinary income for individuals, and anything beyond that carries forward indefinitely. The carryforward does not expire.

The full guide index lists every answer page, and the state comparison covers the state layer on top of these federal figures.