Capital gains tax calculator

Estimate short- and long-term federal capital gains tax plus the 3.8% NIIT on your gain.

Federal capital gains tax$15,000
Net investment income tax (3.8%)$3,800
Total federal tax (18.8%)$18,800
Net after federal tax$81,200

How capital gains are taxed

How long you held an asset changes everything about the tax. A short-term gain (held one year or less) is taxed as ordinary income at your marginal rate - as high as 37%. A long-term gain (held more than a year) gets the preferential 0%, 15%, or 20% rates. This capital gains tax calculator works out which rate applies, adds the 3.8% surtax where relevant, and shows your net.

The 2026 long-term brackets

Long-term rates depend on your total taxable income, not the gain in isolation. For 2026 (single filers):

  • 0% up to about $49,450 of taxable income
  • 15% from there to about $545,500
  • 20% above $545,500

Married-filing-jointly breakpoints are roughly $98,900 and $613,700. The gain stacks on top of your ordinary income, so where it lands determines the rate.

The 3.8% net investment income tax

High earners owe an extra 3.8% NIIT on investment income once modified adjusted gross income exceeds $200,000 (single) or $250,000 (joint). Unlike the brackets above, these thresholds are not inflation-adjusted - they have been fixed since 2013, so more people cross them every year.

Worked example: long-term gain

A $100,000 long-term gain on top of $200,000 of other income (single):

  • The gain sits entirely in the 15% band: $100,000 × 15% = $15,000
  • NIIT: 3.8% × $100,000 = $3,800 (you are over the $200,000 threshold)
  • Total federal tax: $18,800, an effective rate of 18.8%
  • Net: $81,200

Worked example: short-term gain

The same $100,000 gain, but held under a year, is ordinary income:

  • It stacks on your $200,000, pushing part into the 32% and 35% brackets - roughly $33,171 in marginal federal tax
  • Plus the same $3,800 NIIT
  • Total: about $36,971 - nearly double the long-term result

That gap is why the one-year holding line is one of the most valuable dates in investing.

Strategies to lower the bill

  • Hold past one year to convert short-term into long-term treatment.
  • Harvest gains in the 0% band. In a low-income year, you can realize long-term gains that fall under the 0% breakpoint at no federal tax.
  • Tax-loss harvesting. Offset gains with realized losses, then carry excess losses forward.
  • Mind the NIIT cliff. Income just over $200k/$250k pulls the whole 3.8% in - timing income across years can help.

The wash sale rule when harvesting

If you sell an investment at a loss to offset gains, the wash sale rule disallows that loss if you buy the same or a “substantially identical” security within 30 days before or after the sale. The fix is to wait 31 days, or buy a similar-but-not-identical fund to stay invested. The rule applies only to losses, not gains - so harvesting gains in the 0% band is unaffected.

Qualified dividends and inherited assets

Two related items use the same favorable long-term rates:

  • Qualified dividends are taxed at the 0/15/20% long-term rates, not your ordinary rate, so dividend income from most US stocks is taxed like a long-term gain.
  • Inherited assets receive a step-up in basis to their value at the owner’s death, which can erase the built-in gain entirely. Gifting appreciated stock during life does not get the step-up - the recipient inherits your original cost basis instead.

Common mistakes

  • Selling days before the one-year mark and paying the ordinary rate.
  • Forgetting the 3.8% NIIT, which quietly adds to every high earner’s gain.
  • Ignoring state tax - most states tax gains as ordinary income, so add your state rate on top of these federal figures.

If your gains come from equity compensation, pair this with the ESPP calculator and the RSU tax calculator; to weigh converting pre-tax savings in a low-income year, see the Roth conversion calculator.

Frequently asked questions

What is the difference between short and long-term capital gains?
Assets held one year or less are short-term and taxed as ordinary income at your marginal rate. Assets held longer than a year are long-term and taxed at the preferential 0%, 15% or 20% rates based on your taxable income.
What is the 3.8% NIIT?
The net investment income tax adds 3.8% on investment income for single filers with modified adjusted gross income over $200,000 and joint filers over $250,000. These thresholds are not adjusted for inflation.
Does this include state tax?
No. This estimates federal capital gains tax and NIIT only. Most states tax capital gains as ordinary income, so add your state rate separately.
What are the 2026 long-term capital gains brackets?
For 2026, single filers pay 0% up to about $49,450 of taxable income, 15% in the middle band, and 20% above about $545,500. Married-filing-jointly breakpoints are roughly $98,900 and $613,700.

Last reviewed January 2026. This calculator provides general educational estimates based on the inputs you enter and simplified assumptions. It is not financial, tax, legal or investment advice, and figures may differ from your actual liability. Verify with a licensed CPA or financial advisor before acting.