Skip to content

Capital Gains Tax Calculator

Estimate the 2026 federal tax on an investment gain: long-term 0/15/20 percent rates, short-term ordinary rates, and the 3.8 percent net investment income tax.

Federal capital gains tax depends on how long you held the asset and your taxable income. Gains on assets held over a year are taxed at 0, 15, or 20 percent, stacked on top of your ordinary income; gains held a year or less are taxed as ordinary income. High earners also owe a 3.8 percent net investment income tax. This calculator estimates all of it for the 2026 tax year.

Your federal income tax filing status.

$

What you paid for the asset, including commissions.

$

What you sold the asset for, after selling costs.

months

How long you owned the asset. More than 12 months qualifies for long-term rates.

$

Your ordinary taxable income (after deductions), not counting this gain. The gain stacks on top of it.

Share

Total tax on the gain

$2,250.00

Capital gains tax plus any net investment income tax.

Holding period
Long-term (held over 1 year)
Capital gain
$15,000.00
Capital gains tax
$2,250.00
Net investment income tax
$0.00
Effective rate on the gain
15.00%
Gain after tax
$12,750.00

Assumptions

  • Estimates are for the 2026 federal tax year. The gain is the sale price minus the cost basis. A holding period over 12 months is taxed at the long-term rates of 0, 15, or 20 percent; 12 months or less is taxed at ordinary income rates.
  • Long-term capital gains stack on top of your other taxable income: the calculator fills the 0 percent bracket first, then 15 percent, then 20 percent, based on the 2026 thresholds and your filing status. So part of a gain can be taxed at 0 percent and the rest higher.
  • The Net Investment Income Tax adds 3.8 percent on the lesser of the gain or the amount your modified AGI exceeds the statutory threshold ($200,000 single and head of household, $250,000 married filing jointly). These thresholds are not adjusted for inflation.
  • Enter your ordinary taxable income (after the standard or itemized deduction) in the other-income field, since the long-term rate depends on total taxable income. This is an approximation; your exact bracket depends on your full return.
  • Federal tax only. State capital gains tax is not included: many states tax gains as ordinary income (for example California), and some have a separate capital gains tax (for example Washington). A capital loss (sale price below basis) is shown but is treated as zero tax here; loss offsets, carryforwards, and the wash-sale rule are not modeled.
  • Also not modeled: the 28 percent collectibles rate, section 1202 qualified small business stock, section 1250 depreciation recapture on real estate, the qualified dividend stacking interaction, and any state-specific rules. All figures are nominal dollars.
  • This is an estimate for educational purposes only, not tax advice. Confirm current rates and thresholds with the IRS or a tax professional before acting.

How it works

A capital gain is your sale price minus your cost basis. How it is taxed depends on one thing above all: how long you held the asset.

Long-term gains (held more than one year) get the favorable federal rates of 0, 15, or 20 percent. The rate is not flat. The gain stacks on top of your ordinary taxable income, and the calculator fills the 0 percent band first, then 15 percent, then 20 percent, using the 2026 thresholds for your filing status. So part of one gain can be taxed at 0 percent and the rest at 15 percent.

Short-term gains (held one year or less) are taxed as ordinary income. The calculator computes this as the extra federal income tax you owe from adding the gain on top of your other taxable income, which is your ordinary marginal rate.

The Net Investment Income Tax adds 3.8 percent for higher earners. It applies to the lesser of your gain or the amount your modified adjusted gross income exceeds the threshold ($200,000 single and head of household, $250,000 married filing jointly). These thresholds are set by statute and are not adjusted for inflation.

Worked example

Sell an asset for $25,000 that you bought for $10,000, held 24 months, as a single filer with $80,000 of other taxable income, for 2026.

  • Gain: $25,000 minus $10,000 = $15,000, long-term because it was held over a year.
  • Your $80,000 of taxable income sits inside the 15 percent long-term band ($49,450 to $545,500), so the entire $15,000 gain is taxed at 15 percent: $2,250.
  • Modified AGI of $95,000 is below the $200,000 NIIT threshold, so no NIIT applies.
  • After-tax gain: $15,000 minus $2,250 = $12,750.

Had you held the asset only six months, the same $15,000 would be short-term, taxed at your ordinary rate. Stacking it on $80,000 of income pushes it through the 22 percent bracket, costing about $3,300, roughly $1,050 more than the long-term result. The holding period is the biggest lever on the tax.

Scope and limitations

Federal tax only, for the 2026 tax year. Enter your ordinary taxable income (after deductions) so the long-term rate lands in the right band. Not modeled: state capital gains tax (many states, such as California, tax gains as ordinary income, and a few, such as Washington, have a separate tax), capital loss offsets and carryforwards, the wash-sale rule, the 28 percent collectibles rate, section 1202 qualified small business stock, and section 1250 depreciation recapture. A loss is shown but treated as zero tax here. This is an estimate for education, not tax advice.

Sources

Frequently asked questions

What is the difference between long-term and short-term capital gains?
It is how long you held the asset. Held more than one year, a gain is long-term and taxed at the favorable 0, 15, or 20 percent rates. Held one year or less, it is short-term and taxed at your ordinary income rate, which can be much higher. The holding period is the single biggest lever on the tax.
How can my capital gains tax be 0 percent?
The 0 percent long-term rate applies to gains that fall within the 0 percent bracket, which is based on your total taxable income. For 2026 a single filer with taxable income up to $49,450 (including the gain) pays 0 percent on the part of the gain inside that band. Lower other income means more of the gain can be taxed at 0 percent.
Who pays the 3.8 percent net investment income tax?
Higher earners. The NIIT adds 3.8 percent on investment income once your modified adjusted gross income passes $200,000 (single) or $250,000 (married filing jointly). It applies to the lesser of your net investment income or the amount over the threshold, and the thresholds are not indexed for inflation.
Does this include my state's capital gains tax?
No, this is federal only. Most states tax capital gains as ordinary income at the state rate, and a few have separate rules. Add your state's treatment separately. Use the paycheck calculators to see your state's ordinary income rates as a rough guide to how it would tax a short-term gain.

Related calculators

Learn how this works

New to this topic? Our companion guide explains it in plain language: Capital Gains Tax Explained: Long-Term vs Short-Term Rates for 2026

Last reviewed June 2026.