Stoia

Capital Gains Tax Calculator (Long-Term vs. Short-Term)

Estimate the federal tax on investment gains you've realized or are thinking about realizing: long-term and short-term handled separately, NIIT included, plus your effective rate on the combined gain. Enter your taxable income after deductions so the stacking math lands where it should.

Profit on investments held for more than one year

Profit on investments held one year or less

Your income after deductions (not gross): wages, business income, interest

Sets the long-term brackets and the NIIT threshold

Total tax on your gains

$3,000

federal tax on $20,000 of combined gains

Effective rate on the gain

15.0%

total gains tax divided by the combined gain

You keep

$17,000

after federal tax on the gains

Long-term gains tax

$3,000

on $20,000 stacked on top of your other income

Short-term gains tax

$0

no short-term gain entered

Net investment income tax

$0

3.8% surtax; starts above $200,000 of income for this status

Where the combined gain goes

  • You keep$17,00085%
  • Long-term gains tax$3,00015%
  • Short-term gains tax$00%
  • NIIT$00%

Educational estimate for the 2026 tax year, not tax advice. Federal figures follow IRS inflation adjustments; state estimates use statewide rates and standard deductions only and exclude local income taxes (city, county, school district), State Disability Insurance, and credits. Where a state publishes separate married tables, married thresholds may be approximated. Verify your exact withholding with a tax professional or your payroll provider.

The stacking mechanic behind 0/15/20

Long-term gains are not taxed in isolation; they stack on top of your taxable ordinary income. Picture a column: your wages and other income (after the standard deduction) fill it from the bottom, and the gain sits on top. Each slice of the gain is then taxed at the long-term rate of the layer it lands in: the 0% bracket first, then the 15% bracket, then the 20% bracket at the top. That is why the same gain can cost nothing for one person and plenty for another: a higher salary pushes the whole gain into higher layers before it even starts.

One year and a day: why holding period is everything

A capital gain is your sale price minus cost basis, and the calendar decides which table taxes it. Held one year or less, it is short-term: taxed like extra salary, at ordinary rates, on top of everything else. Held more than a year, it is long-term and gets the gentler stack above. For anyone near the boundary, a few weeks of patience is often the highest-return decision available, which is worth checking here before selling.

The same $20,000 gain, two different bills

A single filer with $60,000 of taxable ordinary income realizes a $20,000 long-term gain: the whole gain lands in the 15% layer, so the tax is $3,000, an effective 15.0%. The same gain on $40,000 of taxable income straddles the top of the 0% bracket: part is taxed at nothing, the rest at 15%, for $1,583 total, about 7.9% effective. Same asset, same profit, different bill, purely because of where the stack starts.

The two extra layers people forget

First, the net investment income tax: an additional 3.8% on investment income once income passes a threshold ($200,000 single, $250,000 married filing jointly). It applies to the smaller of your investment income or the amount above the line, and this calculator adds it automatically. Second, most states tax gains as ordinary income at their own rates, so the federal number here is not the whole story. When this matters most: choosing which lot to sell, timing a sale around the one-year mark or a low-income year, and pairing winners with losers via tax-loss harvesting. Large realized gains can also trigger estimated payments during the year, not just a bill in April.

Frequently asked questions

What counts as a long-term capital gain?

Profit on an asset you held for more than one year before selling: stocks, funds, crypto, property. Hold for one year or less and the same profit is short-term, taxed at your ordinary income rates. The clock starts the day after you buy and the one-year line is strict, so a sale a few days early can change the rate that applies.

Can a capital gain really be taxed at 0%?

Yes. Long-term gains stack on top of your taxable ordinary income, and any slice of the gain that lands inside the 0% long-term bracket is taxed at nothing. Retirees and people in low-income years use this deliberately, realizing gains up to the top of the 0% bracket at no federal cost. The calculator shows exactly how much of your gain falls in each layer.

What is the net investment income tax (NIIT)?

An extra 3.8% federal surtax on investment income (capital gains, dividends, interest) once your income crosses a threshold: $200,000 for single filers, $250,000 for married filing jointly. It applies to the smaller of your investment income or the amount above the threshold, and it sits on top of the regular capital gains tax.

Do states tax capital gains too?

Usually, yes. Most states with an income tax treat capital gains as ordinary income at their regular state rates, long-term or not, while a handful of states have no income tax at all. This calculator shows federal tax only, so treat the state layer as a separate line in your estimate.

How accurate is this calculator?

Educational estimate for the 2026 tax year, not tax advice. Federal figures follow IRS inflation adjustments; state estimates use statewide rates and standard deductions only and exclude local income taxes (city, county, school district), State Disability Insurance, and credits. Where a state publishes separate married tables, married thresholds may be approximated. Verify your exact withholding with a tax professional or your payroll provider.

Does this calculator save my numbers?

No. Everything runs in your browser and nothing you type is stored or sent anywhere.

Want this to update itself?

Stoia connects your real accounts and keeps the full picture current: net worth, budgets, and goals. Launching in 2026.

Coming soon