US Capital Gains Tax Calculator

Long- and short-term federal CGT with 2024 IRS brackets and optional NIIT (3.8 %).

How this works

US capital gains tax has two regimes. **Long-term** gains — assets held for more than a year — are taxed at preferential rates of 0 %, 15 % or 20 %, with breakpoints set per filing status. The clever part is that the LTCG brackets stack on top of your ordinary taxable income: if your ordinary income already fills the 0 % LTCG band, your gain enters at 15 %; fill the 15 % band too and the rest is at 20 %. This is why a $20,000 gain can be wholly tax-free for one filer and partly at 15 % for another, with only the salary in between changing.

**Short-term** gains — assets held a year or less — are taxed at your ordinary income tax marginal rate. The calculator approximates this by computing ordinary tax on (income + gain) minus ordinary tax on income alone — the difference is what the gain itself cost you. This handles the case where the gain pushes you into a new ordinary bracket cleanly.

On top of either regime sits **NIIT — Net Investment Income Tax** — a 3.8 % surcharge on investment income (including capital gains) once your Modified Adjusted Gross Income exceeds $200,000 single / $250,000 married joint. The rule is technically the lesser of (investment income) and (MAGI above threshold), but for a gain-only estimator the gain is the operative number once you're past the MAGI threshold. The widget includes an opt-out for NIIT in case your situation has reductions that pull you back below.

State capital gains tax isn't modelled — it varies wildly (zero in seven states including Texas, Florida, Washington and Nevada; up to 13.3 % top marginal in California). Add your state's rate manually if it matters.

The formula

Long-term: tax = Σ slice in LTCG bracket × bracket rate, with the gain stacked on top of ordinary income Short-term: tax = ordinary_tax(income + gain) − ordinary_tax(income) NIIT: tax += min(gain, MAGI − threshold) × 3.8 % (when MAGI > threshold)

LTCG breakpoints 2024: 0 % to $47,025 / $94,050 / $63,000 (single / joint / HoH); 15 % to $518,900 / $583,750 / $551,350; 20 % above. NIIT threshold: $200,000 single / HoH, $250,000 joint. The "other income" field should be your taxable income (after standard deduction), not gross. State CGT, wash-sale rules, like-kind exchanges and the qualified-dividend overlay are all out of scope.

Example calculation

  • Single filer, $75,000 ordinary taxable income, $20,000 long-term gain.
  • Ordinary income ($75k) > LTCG 0 % cap ($47,025), so all $20k of gain enters the 15 % band. Stack ends at $95k — still below the $518,900 15 % cap, so no 20 % portion.
  • Federal CGT = 20,000 × 15 % = $3,000. MAGI ($95k) < NIIT threshold ($200k), so no NIIT. Effective 15.0 %, net gain $17,000.

Frequently asked questions

Why does long-term tax look "all or nothing"?

Because the LTCG brackets are stacked: where your ordinary income lands determines which LTCG rate applies to the start of the gain, and the bracket steps are wide. A single filer with $40,000 income gets the entire 0 % LTCG band ($47,025) available, plus everything up to $518,900 at 15 %. A filer with $48,000 income has used up the 0 % band entirely. Same investment outcome, very different tax bill — the difference can be the whole 15 % on a small gain. It's one of the few US tax provisions that rewards lower-income investors specifically.

When does NIIT actually apply to me?

When your Modified Adjusted Gross Income (MAGI) for the year exceeds $200,000 single / Head of Household or $250,000 married filing jointly. MAGI is your AGI plus a small number of normally-excluded items (foreign-earned income exclusion, mostly). For most filers MAGI ≈ AGI. The 3.8 % rate then applies to the lesser of your total net investment income (gains + dividends + interest + rental net of allowed deductions) and your MAGI excess over the threshold. For someone earning $300k with a $20k LT gain (joint filers), MAGI excess is $50k, investment income is $20k, NIIT base is the lesser ($20k), tax is $760. For someone earning $260k single with the same gain, MAGI excess is $60k, NIIT base is $20k, tax is $760 again — same answer different reason.

Can losses offset my gains?

Yes — within a tax year, capital losses net against capital gains. Short-term losses first net against short-term gains; long-term losses against long-term gains; any remainder crosses between the two. If total losses exceed total gains, you can deduct up to $3,000 ($1,500 if married filing separately) of net capital loss against ordinary income; anything left over carries forward indefinitely. The wash-sale rule complicates this for stocks bought back within 30 days, but that's beyond the scope of a single-input estimator.

Related calculators