Life goals

Capital Gains Tax Calculator

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

Type what you paid, what you sold it for and your other income. We show the federal tax on your profit, and whether keeping it over a year pays less.

Free, no sign-upPrivate — runs in your browserUpdated November 2026
Answers as you type
More
$
$
Held for
$
More options3 already filled in for you
$
Estimated federal tax on the gain
$832.50
Long-term gain, tax year 2026
Capital gain
$15,000.00
Effective rate on the gain
5.55%
You keep after federal tax
$24,167.50
If held 1 year or lessYou save $1,427.50 by holding over a year
$2,260.00
Federal estimate for 2026 (IRS Rev. Proc. 2025-32 thresholds). State tax, collectibles (28%), unrecaptured real estate depreciation (25%) and the home-sale exclusion are not included.
Federal tax: $832.50 (3.3%)Gain kept: $14,168 (56.7%)Original cost: $10,000 (40.0%)Total$25,000
  • Federal tax$832.503.3%
  • Gain kept$14,16856.7%
  • Original cost$10,00040.0%
Step-by-step solution
  1. Gain = sale $25,000 − cost $10,000 = $15,000
  2. Long-term gain stacks on top of $40,000 of other taxable income: $9,450 at 0%, $5,550 at 15%, $0 at 20% = $832.50
  3. NIIT: MAGI $71,100 vs threshold $200,000 → 3.8% × $0 = $0.00
  4. Total = $832.50

How the gain is taxed

RateAmount of gainTax
0%$9,450$0.00
15%$5,550$832.50
20%$0$0.00
NIIT 3.8%$0$0.00

What can I do with my answer?

  1. Holding an investment for more than one year usually means a lower tax rate.
  2. Losses you sell can cancel out gains, and up to $3,000 a year of extra loss can reduce other income.
  3. Keep records of what you paid, including fees, to report the right cost basis.

People also use

Learn more

At a glance

Enter what you paid, what you sold for, how long you held it and your other income to estimate the 2026 federal tax on your gain — and see how much holding for over a year can save.

FormulaGain = Sale price − Cost basis
Long-term tax = (gain in 0% zone × 0) + (gain in 15% zone × 15%) + (gain in 20% zone × 20%)
Short-term tax = Tax(other income + gain) − Tax(other income)
Also searched ascapital gains tax · long term capital gains tax 2026 · short term capital gains · stock sale tax · crypto tax calculator · niit calculator

How to use the capital gains tax calculator

When you sell a stock, fund, cryptocurrency, rental property or other investment for more than you paid, the profit is a capital gain and is taxable. Enter your cost basis (the price you paid plus buying fees), the sale price after selling fees, and whether you owned it for more than one year. Then choose your filing status and enter your other taxable income for 2026 — that is your income after the standard or itemized deduction, not your gross salary.

The calculator shows the estimated federal tax on the gain, the effective rate, how much you keep, and what the tax would be under the other holding period so you can see the value of waiting.

2026 long-term capital gains rates

Gains on assets held more than one year get special rates of 0%, 15% or 20%, based on your total taxable income including the gain. The 2026 thresholds from IRS Revenue Procedure 2025-32 are:

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

Gains on assets held one year or less are short-term and taxed at your ordinary income rates, from 10% up to 37% — the same as wages. You can see those brackets in our federal income tax calculator.

The 3.8% net investment income tax

Higher earners may also owe the 3.8% net investment income tax (NIIT) on the smaller of their investment income or the amount by which modified adjusted gross income (MAGI) exceeds $200,000 (single or head of household), $250,000 (married filing jointly) or $125,000 (married filing separately). These thresholds are set by law and are not adjusted for inflation.

The formula

Gain = Sale price − Cost basis
Long-term tax = (gain in 0% zone × 0) + (gain in 15% zone × 15%) + (gain in 20% zone × 20%)
Short-term tax = Tax(other income + gain) − Tax(other income)

Long-term gains are "stacked" on top of your ordinary taxable income. Your wages fill up the 0% zone first, so only the room left in that zone is available to your gain at 0%.

Worked example

A single filer has $40,000 of other taxable income and sells shares bought for $10,000 for $25,000, a gain of $15,000.

  • Held more than a year: total taxable income becomes $55,000. The first $9,450 of the gain fills the 0% zone up to $49,450 and pays nothing; the remaining $5,550 is taxed at 15%, so the tax is $832.50 — an effective rate of 5.55% on the gain.
  • Held a year or less: the first $10,400 of the gain is taxed at 12% ($1,248) and the remaining $4,600 at 22% ($1,012), for $2,260.

Waiting until the shares were held for more than one year would save $1,427.50. MAGI is roughly $71,100, well under $200,000, so no NIIT applies.

Ways to reduce capital gains tax

  • Hold for more than a year. The holding period starts the day after you buy and includes the day you sell.
  • Harvest losses. Losses offset gains, and up to $3,000 of net loss a year ($1,500 if married filing separately) can reduce ordinary income, with the rest carried forward. Avoid buying the same security within 30 days, or the wash-sale rule disallows the loss.
  • Use the 0% bracket. In a low-income year, such as early retirement, you may be able to realise gains tax-free.
  • Use tax-advantaged accounts. Trades inside a 401(k) or IRA are not taxed each year; see the Roth IRA calculator.

Common mistakes

Entering gross salary instead of taxable income overstates your bracket. Forgetting fees or reinvested dividends understates your basis, so you would pay tax twice on the same money. And the sale of your main home has its own exclusion of up to $250,000 ($500,000 joint) that this tool does not apply. To measure the investment's performance rather than its tax, try the ROI calculator.

This is a federal estimate only and not tax advice. Most states tax capital gains as ordinary income. Sources: IRS Revenue Procedure 2025-32; IRS Topic No. 409 (Capital gains and losses); IRS Topic No. 559 (Net investment income tax).

Checked by the Calcivia team using our checking rules · Last updated .
Cite or link to this page

Using this capital gains tax calculator in an article, report or homework? Copy a citation or a ready-made link:

APACalcivia. (2026). Capital Gains Tax Calculator. Retrieved November 11, 2026, from https://www.calcivia.com/capital-gains-tax-calculator/
MLA"Capital Gains Tax Calculator." Calcivia, 2026, https://www.calcivia.com/capital-gains-tax-calculator/. Accessed 11 Nov. 2026.
HTML link<a href="https://www.calcivia.com/capital-gains-tax-calculator/">Capital Gains Tax Calculator</a> by Calcivia
Did this help you?

Questions people ask

What is the long-term capital gains tax rate for 2026?

It is 0%, 15% or 20% depending on taxable income. For a single filer the 0% rate applies up to $49,450 of taxable income and the 20% rate starts above $545,500; for married filing jointly the limits are $98,900 and $613,700.

How long do I need to hold an investment for long-term rates?

More than one year. If you sell after exactly 12 months or less, the gain is short-term and taxed at your ordinary income tax rate.

Do I pay capital gains tax if I reinvest the money?

Yes. In a regular taxable account, selling at a gain is a taxable event even if you immediately buy something else. Trades inside a 401(k) or IRA are not taxed at the time of the trade.

Who pays the 3.8% net investment income tax?

People whose modified AGI exceeds $200,000 (single or head of household), $250,000 (married filing jointly) or $125,000 (married filing separately). It applies to the smaller of investment income or the excess over the threshold.

Can capital losses reduce my taxes?

Yes. Losses first offset capital gains, then up to $3,000 a year ($1,500 married filing separately) of remaining loss reduces ordinary income. Any unused loss carries forward to future years.