Capital Gains Tax Calculator

Estimate the federal tax on selling stock, funds or other investments, at short- or long-term rates, with the 3.8% net investment income tax

Your Sale and Income

$

What you paid, including fees

$

What you received, after fees

$

Wages and other income, before deductions

%

Optional; many states tax gains as income

Estimated tax on your gain

$2,250

15.0% of a $15,000 long-term gain · you keep $12,750 of the profit

Federal income tax

$2,250

top rate on this gain: 15%

Net investment income tax

$0

none: income under $200,000

State tax

$0

enter your state's rate to include it

If sold within a year

$3,300

holding over a year saves you $1,050

How your gain is taxed

The $15,000 gain stacks on top of your other taxable income

Loading chart…

Long-term vs short-term

Total tax on the same gain

Loading chart…

How Capital Gains Are Taxed

Profit on an investment you held more than a year is a long-term gain, taxed at 0%, 15% or 20% depending on your taxable income. Gains on investments held a year or less are taxed as ordinary income, at up to 37%. Higher earners also pay the 3.8% net investment income tax.

This is a federal estimate using 2026 brackets. It doesn't cover collectibles (taxed at up to 28%), depreciation recapture on property, the alternative minimum tax or credits.

The Formulas

Gain = sale price − cost basis

Long-term rate: 0%, 15% or 20% by taxable income

NIIT = 3.8% × min(gain, income − threshold)

Long-term gains are stacked on top of your other taxable income, so they fill the 0% bracket first only if your other income leaves room.

Ways to Pay Less

  • •Holding more than a year usually cuts the rate sharply
  • •Sell losers to offset gains (tax-loss harvesting), up to $3,000 of other income too
  • •Rebuying the same stock within 30 days of a loss sale disallows the loss (wash sale)
  • •In a low-income year, long-term gains may fall in the 0% bracket
  • •Gains inside a 401(k) or IRA aren't taxed when you sell