CAPITAL GAINS TAX CALCULATOR

Capital gains tax calculator

Enter your purchase and sale, estimate the tax.

$
$
$

What are the 2026 capital gains tax rates?

Long-term gains are taxed at 0%, 15% or 20% by taxable income. For single filers: 0% up to $49,450, 15% up to $545,500 and 20% above. For joint returns: $98,900 and $613,700; head of household: $66,200 and $579,600.

How is the rate chosen?

Gains stack on top of your other taxable income. Single with $40,000 of other taxable income and a $20,000 long-term gain: $9,450 fits under $49,450 at 0%, the other $10,550 is taxed at 15% — $1,582.50.

What is the difference between long-term and short-term?

Assets held more than a year get the lower long-term rates. Held a year or less, the gain is taxed like wages at your regular bracket.

What is the Net Investment Income Tax?

An extra 3.8% on investment income for people with modified AGI over $200,000 ($250,000 joint, $125,000 married filing separately). These thresholds are not adjusted for inflation.

What does the calculator assume?

It estimates modified AGI as your taxable income plus the gain plus the standard deduction, and ignores special 25% and 28% gains (real estate depreciation, collectibles) and state taxes.

How is the gain calculated?

The gain is the sale price minus the basis, which is generally what you paid plus costs of buying and selling. If shares sold for $50,000 had cost $32,000 and the selling fees were $250, the gain is $50,000 − $32,000 − $250 = $17,750.

Can capital losses reduce my tax?

Yes. Losses first offset capital gains. If losses are larger than gains, up to $3,000 ($1,500 if married filing separately) can reduce other income in a year, and the remainder carries forward to later years (IRS Topic 409).

Does the home sale exclusion apply here?

No. When you sell your main home, up to $250,000 of gain ($500,000 on a joint return) may be excluded if you owned and lived in it for at least two of the five years before the sale. This calculator does not apply that exclusion, so enter only the taxable part of the gain.

How the calculation works

For a long-term gain, the calculator stacks the gain on top of your other taxable income. The part that fits below the 0% limit is untaxed, the part up to the 15% limit is taxed at 15%, and any amount above that is taxed at 20%. For a short-term gain, the gain is added to ordinary income and taxed at the ordinary rates, so the tax is the difference between the tax on income with and without the gain. Separately, the 3.8% net investment income tax applies to the smaller of the gain and the amount by which modified adjusted gross income is over the threshold for your filing status.

Worked example

A single filer has $70,000 of other taxable income and sells shares for a $30,000 gain. Held more than a year, the whole gain falls in the 15% band, so the tax is $4,500; the NIIT does not apply, since modified AGI is below $200,000, and the effective rate is 15.0%. If the same shares were held a year or less, the gain is added to ordinary income and the tax is $6,600, an effective rate of 22.0%.

A larger example with $520,000 of other taxable income and a $50,000 long-term gain shows all three layers. The total reaches $570,000, above the $545,500 limit for the 15% rate, so part of the gain is taxed at 15% and the rest at 20%: tax of $8,725. Modified AGI is far above $200,000, so the NIIT adds $1,900, for $10,625 in all.

Common mistakes

  • Using total income instead of taxable income. The rate bands are in terms of taxable income, after deductions. Entering gross pay overstates the tax.
  • Counting the holding period wrongly. Long-term treatment needs a holding period of more than one year. A sale after exactly one year is still short-term.
  • Forgetting the basis. Tax is on the gain, not the sale price. Reinvested dividends and purchase costs raise the basis and reduce the gain.

Sources and related calculators

Rates, brackets and thresholds: IRS Topic No. 409 (Capital Gains and Losses), IRS Publication 550 (Investment Income and Expenses) and the 2026 inflation adjustments; Net Investment Income Tax: IRS guidance under section 1411. Related: income tax calculator, paycheck calculator and 401(k) calculator.

An estimate for planning only — not tax advice. Credits, other taxes and special cases are not included; your tax return decides. How we check our calculators.