Skip to content
FreedomClock

Answers: How much tax will I pay when I sell an investment?

Capital Gains Tax Calculator

What you’ll owe when you sell: short vs. long term, with the 3.8% NIIT and state tax.

  • Instant results
  • Private — runs in your browser
  • Free, no sign-up

Your numbers

$
$
$/yr

Estimated tax on your gain

$7,290

About 24.3% of your $30,000 long-term gain goes to tax. You’d walk away with $42,710 from the sale.

Federal tax

$4,500

0% / 15% / 20% rates

Net investment income tax

$0

Starts above $200K of income

California tax

$2,790

On top of federal

You keep

$42,710

Sale price − costs − tax

Your gain, stacked on top of your other income

Long-term gains sit on top of everything else, so your other income decides which zone each dollar of gain lands in.

Tax-free (deduction)Other incomeGain at 0%Gain at 15%Gain at 20%

Short-term vs. long-term

Total tax on this sale (federal + NIIT + state) depending on how long you held it.

How this capital gains tax calculator works

Enter what you paid, what you sold for, how long you owned it, your other income, and where you live. The calculator figures your 2026 tax twice, once with the sale and once without, and reports the difference as the tax on the sale. It works this way because a gain doesn’t have its own tax rate. It stacks on top of everything else you earned that year.

The formula

Gain = sale price − selling costs − cost basis

Tax on the sale = tax with the gain − tax without it (federal + 3.8% NIIT + state)

Example: a single filer with $60,000 of salary has $43,900 of taxable income after the $16,100 standard deduction. A $20,000 long-term gain sits on top, running from $43,900 to $63,900. The first $5,550 of the gain fits under the $49,450 ceiling for the 0% rate; the remaining $14,450 is taxed at 15%. The federal tax on the gain is $2,167.50, an effective rate under 11%. Sold short-term, the same gain would be taxed at 12% and 22%, costing $3,750.

Reading the income tower

The tower is your income for the year. At the bottom is the slice your standard deduction shelters from tax, then your other income, then the gain on top. The colored bands behind it are the tax zones. Any piece of the gain inside the green band pays 0%, gold pays 15%, and orange pays 20%. A dashed red line marks where the 3.8% net investment income tax begins.

Ways to lower capital gains tax

  • Hold for more than a year. Past the one-year mark, the gain moves from ordinary rates (up to 37%) to the long-term rates of 0%, 15% or 20%.
  • Time sales for lower-income years. In early retirement or a sabbatical year, more of a gain can land in the 0% zone.
  • Harvest losses. Selling losing investments offsets gains, and up to $3,000 of extra losses offsets other income.
  • Give appreciated assets. Donating stock you’ve held over a year to charity means no one pays tax on the gain. Heirs who inherit assets get a stepped-up cost basis, which wipes out the gain built up during your lifetime.

Not included: the 25% rate on depreciation recapture from real estate, the 28% rate on collectibles, the home-sale exclusion, and the alternative minimum tax.

Frequently asked questions

What are the 2026 long-term capital gains tax rates?+

0%, 15% or 20%, depending on your taxable income including the gain. For 2026 the 0% rate applies up to $49,450 of taxable income for single filers ($98,900 married filing jointly, $66,200 head of household). The 15% rate applies up to $545,500 single ($613,700 joint, $579,600 head of household), and 20% applies above that.

What's the difference between short-term and long-term gains?+

It depends on how long you owned the asset. Sell after more than one year and the gain is long-term, taxed at 0%, 15% or 20%. Sell after one year or less and it's short-term, taxed at your ordinary income tax rates (up to 37%), the same as wages.

What is the 3.8% net investment income tax?+

An extra 3.8% federal tax on investment income, including capital gains, dividends and interest, for people whose modified adjusted gross income is above $200,000 (single or head of household) or $250,000 (married filing jointly). It applies to whichever is smaller: your investment income or the amount you're over the threshold. These thresholds aren't adjusted for inflation.

Do I pay state tax on capital gains?+

Yes, in most states. Capital gains are taxed as regular income at state rates. Nine states have no tax on wages, though Washington taxes long-term gains above a large annual exemption. A few states, such as Arkansas, North Dakota, South Carolina and Wisconsin, exclude part of long-term gains. The calculator applies a simplified version of each state's rules.

Can capital losses reduce my taxes?+

Yes. Losses first offset gains. If your losses are bigger than your gains, you can deduct up to $3,000 a year ($1,500 if married filing separately) against other income, and carry the rest forward to future years with no expiration.

Do I pay capital gains tax when I sell my house?+

Often not. If you owned and lived in the home for at least two of the five years before the sale, you can exclude up to $250,000 of gain ($500,000 for married couples filing jointly). Only the gain above that is taxed. This calculator doesn't apply the exclusion, so subtract it from your gain first if it applies.

Keep going

Freedom Clock for iPhone

Carry your freedom date in your pocket.

  • Save a base plan + unlimited what-ifs
  • Stress-test crashes and life events
  • Log money wins — see days gained
  • Quarterly check-ins keep you on track

Capital Gains results are estimates for educational purposes only and are not financial, tax, legal or investment advice. Verify important decisions with a qualified professional..