Capital Gains Tax Calculator

Federal tax on a long-term capital gain, stacked the way the IRS actually does it: your ordinary income fills the rate bands first, and the gain is taxed at 0%, 15%, and 20% only in the band space above it — with the optional 3.8% net investment income tax on top.

Tax on your long-term gain

Example: $40,000 gain on $40,000 ordinary income, single, 2026 → $9,450 of the gain at 0%, $30,550 at 15% — $4,583.

Net investment income tax

Enter your income and gain to see the 0/15/20 breakdown.

The example, stacked

A $40,000 long-term gain on top of $40,000 of taxable ordinary income, single, 2026: the 0% band runs to $49,450 of taxable income, and ordinary income has already used $40,000 of it. So the first $9,450 of the gain rides free at 0%, and the remaining $30,550 is taxed at 15% — $4,583 in all, an effective 11.46% on the gain. One gain, two rates: that is the stacking most "what's my capital gains rate?" tables quietly skip. Every figure on this page is computed at build time by the same tested engine as the calculator above. If "bands of taxable income" is a new idea, the guide How Tax Brackets Actually Work explains the slice-by-slice model that this page builds on: the long-term bands use the same mechanism as the ordinary brackets, with different breakpoints and lower rates. The rest of this site's explainers are collected under Guides.

What the engine actually does

The calculator does one thing, and it helps to see it exactly. Your long-term gain occupies an interval of taxable income that starts at your taxable ordinary income and ends at ordinary income plus the gain. The 2026 schedule has three preferential bands — 0% up to a first breakpoint, 15% up to a second, 20% above — and the engine taxes only the part of your interval that overlaps each band. Ordinary income sits underneath and consumes the low bands first, so a gain can never reach back down into a 0% band that wages have already filled. The ordinary income itself is not re-priced here: it is taxed at the ordinary bracket rates, which the Tax Bracket Calculator and Federal Income Tax Calculator compute, and this page reports only the tax the gain adds on top. The breakpoints differ by filing status, which is why the form asks for it:

Filing status (2026) 0% band, taxable income up to 15% band, up to 20% band NIIT MAGI threshold
Single $49,450 $545,500 above $545,500 $200,000
Married filing jointly $98,900 $613,700 above $613,700 $250,000
Married filing separately $49,450 $306,850 above $306,850 $125,000
Head of household $66,200 $579,600 above $579,600 $200,000

Every figure in that table is read at build time from this site's single tax-year data file — the same file the calculator reads — and the methodology page names the revenue procedure behind each year's breakpoints. The year selector offers 2026 and 2025; the long-term breakpoints are indexed and move each year, while the NIIT thresholds in the last column are statutory and do not.

Same gain, three prices

Because the bands are measured on total taxable income, the tax on a gain depends on what sits underneath it. Here is one $30,000 long-term gain, single, 2026, placed on three different amounts of taxable ordinary income:

Taxable ordinary income Where the gain sits Slices of the gain Tax on the gain Effective rate on the gain
$0 $0 – $30,000 $30,000 at 0% $0.00 0%
$40,000 $40,000 – $70,000 $9,450 at 0% + $20,550 at 15% $3,082.50 10.27%
$600,000 $600,000 – $630,000 $30,000 at 20% $6,000.00 20%

The first row is the whole interval inside the 0% band: $0.00 of tax on a real gain. The middle row is the case a "capital gains rate" lookup cannot express — $9,450 of the gain fits under the $49,450 breakpoint and the remaining $20,550 does not, so the gain is priced at two rates and the effective rate, 10.27%, is neither of them. The last row starts above the 15% ceiling of $545,500, so the entire gain lands at 20%. Identical sale, identical proceeds: $0.00 to $6,000.00, decided entirely by the income the gain is stacked on. This is why the calculator asks for ordinary income at all, and why a year with unusually low or high ordinary income prices the same gain differently — a description of the mechanism, not a recommendation about timing.

Married filing jointly: a gain the 0% band absorbs

Filing status moves the breakpoints, and for a joint return it moves them a long way: the 0% band ends at $98,900 of taxable income rather than the single filer's $49,450. Take $30,000 of long-term gain on $60,000 of taxable ordinary income in 2026, married filing jointly. The entire interval, $60,000 to $90,000, sits below the joint breakpoint: $0.00 of tax on the gain, an effective 0%. The identical numbers on a single return sit entirely above the single breakpoint and entirely below the 15% ceiling: $4,500.00, all of it at 15%. Same gain, same income, same year; only the status changed. Read the joint result carefully, though — it says the gain adds nothing, not that the couple owes nothing. The $60,000 of ordinary income is still taxed at the ordinary bracket rates, and that tax is not part of this page's output.

Married filing separately: why this engine models it

This calculator offers married filing separately, and the methodology page states the rule behind that: separate filing exists on this site only where its own thresholds are meaningfully different — in the capital-gains engine, which this page and the Crypto Capital Gains Tax Calculator share, and in the five OBBBA deduction tools (senior, SALT, car-loan, standard-deduction, and charitable), which model it separately. The Tax Bracket, Federal Income Tax, and Take-Home Pay calculators model single, married filing jointly, and head of household only; the bonus withholding and self-employment tools ask for no filing status at all, because their computations do not depend on one. Here the long-term breakpoints and the NIIT threshold for separate filers differ from the joint figures, which is what the status selector changes. For 2026, a separate filer's 0% band ends at $49,450 and the 15% band at $306,850 — compare $545,500 for a single filer and $613,700 on a joint return — and the NIIT threshold is $125,000 against $250,000 jointly. The separate-filer figures are read from the data file rather than derived from the joint ones.

Worked through the engine: $100,000 of long-term gain on $250,000 of taxable ordinary income, 2026. Filing separately, the interval runs from $250,000 to $350,000 and crosses the separate-filer ceiling: $56,850.00 of the gain is taxed at 15% ($8,527.50) and the remaining $43,150.00 at 20% ($8,630.00) — $17,157.50 in all, an effective 17.16% on the gain. The same interval on a joint return sits entirely inside the 15% band: $15,000.00. Which status a couple uses depends on facts this page does not have; it prices the gain under whichever status you select.

Short-term gains are ordinary income

Held one year or less, a gain is not a capital-gains-rate question at all. It is ordinary income, priced by the bracket schedule, and this calculator does not accept it. The same engine can still price one exactly — as the federal income tax with the gain minus the tax without it. A $10,000 short-term gain on $45,000 of taxable ordinary income, single, 2026: without the gain the filer's last dollar sits in the 12% bracket; with it, the top of the income has crossed into the 22% bracket, and the gain adds $1,660.00 of tax. The same $10,000 as a long-term gain straddles the 0% and 15% bands — $4,450.00 free and $5,550.00 at 15% — for $832.50. Same sale, $827.50 apart, and the only difference is the holding period.

To price a short-term gain, add it to your ordinary income in the Federal Income Tax Calculator; the How Tax Brackets Actually Work guide explains why crossing into the 22% bracket re-prices only the dollars above the threshold, never the income below it. If you have both kinds of gain in the same year, net short-term gains are part of the ordinary income that long-term gains stack on — enter them in the ordinary-income field here. For digital assets, the Crypto Capital Gains Tax Calculator runs this same engine with a short-term quick check built in and the crypto-specific rules around it.

The NIIT and the lesser-of rule

Ticking "Include the 3.8% NIIT" adds the net investment income tax (IRC § 1411). It is not a fourth band. It applies to the lesser of two amounts: the gain, or the amount by which your modified AGI exceeds a threshold that depends on filing status — $200,000 single or head of household, $250,000 married filing jointly, $125,000 married filing separately. Those thresholds are statutory and not indexed for inflation, so they live in the same data file but outside its per-year entries, and do not move with the breakpoints above.

Worked through the engine: $60,000 of long-term gain on $180,000 of taxable ordinary income, head of household, 2026, NIIT on, MAGI field left blank. The gain sits entirely in the 15% band: $9,000.00. For the threshold test the engine uses ordinary income plus gain, $240,000, which exceeds the head-of-household threshold by $40,000 — less than the gain — so the NIIT base is $40,000, not $60,000, and the surtax is $1,520.00. Total $10,520.00, an effective 17.53% on the gain. Enter a MAGI of $300,000 instead and the excess is larger than the gain, so the whole $60,000 becomes NIIT base: $2,280.00 of surtax and $11,280.00 in total. The result box shows which amount the rule picked on the "NIIT" line, so the lesser-of test is never hidden inside a total.

Why the blank default is a floor rather than a guess: MAGI is measured before deductions and taxable ordinary income after them, so income plus gain can only understate your true MAGI. The default can understate the NIIT; it cannot invent one. If you know your MAGI for this purpose (the Form 8960 figure), enter it and the lesser-of rule uses it instead.

How to read the output

The result box leads with the total federal tax on the gain, then one line per band the gain touches — the dollars of gain in that band and the tax from that slice — then the NIIT line when it is on, then the effective rate on the gain. Three misreadings are common. First, the effective rate is tax divided by the gain, not by your income; it describes what the sale cost, not your overall rate. Second, a 0% slice is not tax-free income in general — it is gain that fell inside a band whose rate for long-term gains is 0%, and the ordinary income beneath it was taxed normally. Third, a result that lands entirely at one rate is the coincidence of your interval fitting inside one band, not evidence that the rate is "yours"; move the ordinary income and the split reappears. The copy button records the total, the gain, the tax year, and the effective rate in one line so the year is never separated from the number.

Why the stacking matters

The long-term rates are not a lookup — they are bands of taxable income (2026 single: 0% to $49,450, 15% to $545,500, 20% above). Your gain occupies the interval from your ordinary income upward, so the same gain can cost nothing, be split across rates, or land entirely at 20% depending on what sits underneath it, as the three-row table above shows. To find the taxable ordinary income this page asks for, the Tax Bracket Calculator applies your standard deduction for you; for the whole-paycheck picture including FICA, use the Take-Home Pay Calculator.

What this tool deliberately leaves out

Scope is federal tax on plain long-term gains — the following are real, and excluded by design rather than modeled badly:

  • State and local taxes — out of scope entirely; this site models federal tax only.
  • Short-term gains (held one year or less) — ordinary income at bracket rates; price them with the Federal Income Tax Calculator.
  • Unrecaptured § 1250 gain — depreciation previously taken on sold real estate is taxed under its own rule, not the 0/15/20 bands.
  • Collectibles and § 1202 QSBS gain — each carries its own maximum rate and is not modeled.
  • The § 121 home-sale exclusion — part of a primary-residence gain may be excluded before any of this applies; the exclusion is not modeled.
  • Netting and carryovers — capital losses, short-against-long netting, and loss carryovers happen before this page starts; bring the net long-term gain they produce.
  • Qualified dividends — they share the same 0/15/20 bands and would stack alongside the gain; they are not modeled.

Frequently asked questions

Is my whole gain taxed at one capital-gains rate?

No — that is the point of this calculator. The 0%, 15%, and 20% rates are bands of taxable income, and a long-term gain stacks on top of your ordinary income. Ordinary income fills the low bands first; the gain then occupies whatever band space is left, so one gain is often split across two rates. A single "your rate is X%" answer hides that split.

What counts as a long-term gain?

Gain on an asset held for MORE than one year before selling. Held one year or less, the gain is short-term and is taxed as ordinary income at your regular bracket rates — this calculator does not model that; use the tax bracket or take-home pay calculators to price ordinary income.

What is the net investment income tax (NIIT)?

An additional 3.8% tax (IRC section 1411) on the LESSER of your net investment income or the amount your modified AGI exceeds a threshold: $200,000 single or head of household, $250,000 married filing jointly, $125,000 married filing separately. The thresholds are set by statute and are NOT adjusted for inflation. The calculator applies the lesser-of rule to the gain you enter.

Does this calculator model married filing separately?

Yes. Separate filing exists on this site only where its own thresholds are meaningfully different: in the capital-gains engine, which this page and the crypto capital gains calculator share, and in the five OBBBA deduction tools (senior, SALT, car-loan, standard-deduction, and charitable), which model it separately. Here the long-term breakpoints and the NIIT threshold for separate filers differ from the joint figures: for 2026, the 15% band ends at $306,850 of taxable income for a separate filer against $613,700 on a joint return, and the NIIT threshold is $125,000 against $250,000. The tax bracket, federal income tax, and take-home pay calculators model single, married filing jointly, and head of household only; the bonus and self-employment tools ask for no filing status at all.

What happens if I leave the modified AGI field blank?

The engine uses your taxable ordinary income plus the gain as the MAGI for the NIIT threshold test. True MAGI is measured before deductions and taxable income after them, so that default is a floor: it can understate the NIIT but never invent one. If you know your MAGI for this purpose (the Form 8960 figure), enter it and the lesser-of rule uses it instead.

Does a long-term gain push my ordinary income into a higher bracket?

Not in this model. The gain occupies the taxable-income interval ABOVE your ordinary income, and the ordinary income is priced by the bracket schedule as if the gain were not there. The gain does raise your total taxable income and your AGI, which is exactly why the NIIT threshold test and the placement of the gain within the 0/15/20 bands depend on it — but it does not re-price the dollars below it.

What does this calculator deliberately not model?

State and local taxes on gains; short-term gains (taxed as ordinary income); unrecaptured section 1250 depreciation on real estate and collectibles or section 1202 QSBS gain, each of which has its own rate rule outside the 0/15/20 bands; the section 121 home-sale exclusion that may remove part of a primary-residence gain before any of this math starts; and qualified dividends, which share the same bands. Each is disclosed here rather than approximated badly.

Why does it ask for taxable ordinary income rather than salary?

The 0/15/20 breakpoints are defined on TAXABLE income — after the standard or itemized deduction — so the stacking is only correct if the ordinary income you enter is already net of deductions. If you only know your salary, subtract your deduction first (the tax bracket calculator does exactly that step).

Which tax years does it cover, and where do the breakpoints come from?

The year selector offers 2026 and 2025. Every breakpoint is read from this site's single tax-year data file, which records the IRS revenue procedure behind each year's figures (listed on the methodology page); when a new year is published, the file gains an entry and every calculator and worked example on this site updates together.

Not tax advice: a federal planning estimate for plain long-term gains and, optionally, the NIIT — using the taxable ordinary income you supply, with none of the exclusions listed above modeled. Netting rules (short against long, capital-loss carryovers) and qualified dividends sharing the same bands can change the result. Consult a tax professional or IRS.gov for your situation. Values are processed locally in your browser and never transmitted. See the methodology page and the disclaimer.