Grow

Capital Gains Tax Calculator

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

Updated Free, no sign-upRuns in your browser

$
Cost basis, including fees.
$
You owned it for
$
Salary and other ordinary income, before deductions.
%

Tax on your gain

$3,000

On a $20,000 long-term gain.

Federal capital gains tax
$3,000
Net investment income tax
$0
State tax
$0
Rate on the gain
15.0%
You keep
$17,000

Capital Gains Tax Calculator by Dollars World ·Open the full version

How capital gains are taxed

Gain = sale price − cost basis

  • Short-term (owned a year or less): taxed like wages, at your regular bracket rates.
  • Long-term (owned more than a year): taxed at 0%, 15% or 20%. The gain sits on top of your other taxable income, so part of it can fall in the 0% band and part in a higher one.
  • Net investment income tax: an extra 3.8% on investment income once your modified AGI passes $200,000($250,000 married filing jointly).

2026 long-term capital gains rates

Filing status0% up to15% up to
Single$49,450$545,500
Married filing jointly$98,900$613,700
Head of household$66,200$579,600

Amounts are taxable income, including the gain. Above the 15% limit, gains are taxed at 20%.

Worked example

You're single, earn $80,000 and sell shares for a $20,000 gain. After the $16,100 standard deduction, your other taxable income is $63,900, already past the 0% limit, so the whole gain is taxed at 15%: $3,000.

Sell within a year instead and the gain is taxed as ordinary income in the 22% bracket: $4,400, or $1,400 more.

Ways to pay less

  • Wait past the one-year mark before selling, when you can.
  • Offset gains with losses. Losses cancel gains, and up to $3,000 of extra loss a year comes off your other income, with the rest carried forward.
  • Use retirement accounts. Trades inside a 401(k) or IRA aren't taxed as you go. See the Roth IRA calculator.
  • Mind low-income years. In a year with little other income, some or all long-term gains may fall in the 0% band.

Questions people ask

Is there a tax break when I sell my home?

Yes. If you owned and lived in it for at least two of the last five years, up to $250,000 of gain ($500,000 for married couples filing jointly) is generally excluded. This calculator doesn't apply that exclusion.

Do I pay tax if I reinvest the money?

Yes. Selling triggers the gain even if you buy something else straight away, unless the trade happens inside a retirement account.

Sources

Reviewed September 26, 2026 by The Dollars World team. How we build and check our calculators · Our data and formulas. This is general information, not financial advice.

Add this calculator to your website

Free to use on your blog or site. Paste this code where you want the calculator to appear. It resizes itself and stays up to date.

All 63 calculators you can embed, and unbranded licenses for businesses