1. Calculators
  2. Taxes, Inflation & Currency

Capital Gains Tax Calculator

Estimate the US tax on an investment you sold, side by side as a short-term and a long-term gain, including the 3.8% net investment income tax and your state rate. A second tool nets a year of gains and losses and shows how much loss you can deduct and carry forward.

Updated Oct 16, 2026Free · no sign-upFormulas tested

Your inputs

US federal tax for 2026 on one sale, shown both as a short-term and as a long-term gain, plus the 3.8% NIIT and a state rate.

Your other income is
$
Taxable income from Form 1040 without this sale: income after the standard or itemized deduction.
$
What you paid for the whole position, including the purchase commission.
$
$
Commission and fees on the sale.
%
Most states tax capital gains as ordinary income. 0 if your state has no income tax.
Holding period

Results

Total tax (long-term)$2,392.0020.0% of a $11,960.00 gain, federal 2026 and state
Capital gain
$11,960.00
Sale price − purchase price − selling costs
After-tax profit
$9,568.00
Effective rate on the gain
20.0%
Total tax if short-term
$3,229.20
Federal $2,631 at ordinary rates
Total tax if long-term
$2,392.00
Federal $1,794 at 0% / 15% / 20%
Saved by holding more than a year
$837.20
Net investment income tax
$0.00
MAGI about $98,060; threshold $200,000

Held more than a year, this gain costs $2,392 in tax. The same sale as a short-term gain would cost $3,229, a difference of $837.

Tax on a $11,960 gain at different income levels

Short-termLong-term
$0$2K$4K$6K$25k$50k$75k$100k$150k$250k$500k

Short-term versus long-term

Short-termLong-term
Federal income tax$2,631.20$1,794.00
Net investment income tax$0.00$0.00
State tax$598.00$598.00
Total tax$3,229.20$2,392.00
Effective rate27.0%20.0%
After-tax profit$8,730.80$9,568.00

Total tax on the same gain at other income levels (single)

Taxable income from other sources, not counting the $11,960 gain. Includes NIIT and the state rate.

Other taxable incomeShort-termLong-termDifferenceLong-term rate
$25,000$2,033.20$598.00$1,435.205.0%
$50,000$3,189.20$2,392.00$797.2020.0%
$75,000$3,229.20$2,392.00$837.2020.0%
$100,000$3,354.40$2,392.00$962.4020.0%
$150,000$3,468.40$2,392.00$1,076.4020.0%
$250,000$5,051.73$2,846.48$2,205.2523.8%
$500,000$5,238.48$2,846.48$2,392.0023.8%

Results are estimates from the numbers you enter. They are not financial, tax or legal advice.

How to use the capital gains tax calculator

Tax on a sale estimates the tax on a single sale and shows it both ways: as a short-term and as a long-term gain. Capital losses nets a full year of gains and losses and works out the deduction and carryforward.

  1. Filing status and other income. Choose whether you know your taxable income (after the standard or itemized deduction, as shown on last year’s Form 1040) or only your gross income. With gross income the calculator subtracts the 2026 standard deduction for you. Do not include the sale itself.
  2. Purchase and sale price. Enter the totals for the whole position, not per share. Include the purchase commission in the purchase price; it is part of your cost basis.
  3. Selling costs. Commissions and fees on the sale. They reduce the gain.
  4. State tax rate. Your state’s rate on the gain, or 0.
  5. Holding period. More than one year makes the gain long-term.

The results show the tax for the holding period you chose, the alternative next to it, and the difference. The tables compare both treatments line by line and at seven income levels.

How capital gains tax is calculated

Capital gain = Sale price − Purchase price (cost basis) − Selling costs
Short-term tax = Income tax(Other income + Gain) − Income tax(Other income)
Long-term tax = the part of the gain in each band × 0%, 15% or 20%The gain is stacked on top of your other taxable income, so your other income decides which rates the gain reaches. Bands and brackets are the official 2026 figures.
NIIT = 3.8% × smaller of (Gain, MAGI − Threshold)
State tax = Gain × State rate
Effective rate = (Federal + NIIT + State) ÷ GainThe net investment income tax threshold is $200,000 of modified adjusted gross income (MAGI) for single filers and $250,000 for joint filers. The calculator estimates MAGI from your inputs.

A worked example

A single filer with $70,000 of taxable income sells a position bought for $20,000 for $32,000, paying $40 in selling costs. The capital gain is $11,960.00.

Held more than a year, the gain falls entirely in the 15% band: $1,794.00 of federal tax. A 5% state rate adds $598.00, and MAGI of about $98,060 is far below the NIIT threshold. Total tax is $2,392.00, an effective rate of 20.0%, leaving $9,568.00 of after-tax profit.

Sold within a year, the same gain would be taxed at the 22% ordinary rate: $2,631.20 federal and $3,229.20 in total. Waiting past the one-year mark saves $837.20.

Short-term versus long-term at different incomes

Your other income changes the answer more than anything else. The same $11,960.00 gain, no state tax, single filer:

Other taxable income Short-term tax Long-term tax Long-term rate
$30,000 $1,435.20 $0.00 0.0%
$70,000 $2,631.20 $1,794.00 15.0%
$250,000 $4,453.73 $2,248.48 18.8%
$600,000 $4,640.48 $2,846.48 23.8%

At $30,000 the whole gain fits under the $49,450 line and is taxed at 0%. At $250,000 the gain also triggers the net investment income tax ($454.48), and at $600,000 it falls in the 20% band with NIIT on top. In dollar terms the gap is largest in the upper brackets, where short-term gains are taxed at 32% to 37% while long-term gains pay 15% or 20% plus NIIT.

A few kinds of long-term gain have their own maximum rates: up to 28% on collectibles such as art, coins and physical gold, and up to 25% on the part of a real estate gain that reflects past depreciation (unrecaptured section 1250 gain). This calculator applies the standard 0/15/20% rates.

How capital losses work

A sale below your cost basis produces a capital loss. Losses are not wasted:

  1. They offset gains first. Short-term losses net against short-term gains and long-term losses against long-term gains, then any remaining loss in one group offsets gains in the other.
  2. Up to $3,000 a year comes off ordinary income once all gains are used up ($1,500 if married filing separately).
  3. The rest carries forward indefinitely, used against future gains first and then at the annual limit.

In the Capital losses tool, a single filer has $2,500 of short-term gains, $9,000 of short-term losses, $1,500 of long-term gains and $4,000 of long-term losses. After netting, the net capital loss is $9,000.00. $3,000.00 reduces ordinary income this year, worth $1,435.00 in federal tax counting the gains it cancelled, and $6,000.00 carries forward: $3,500.00 short-term and $2,500.00 long-term.

If the same filer had $20,000 of long-term gains instead, the losses would offset part of them, leaving a net gain of $9,500.00 taxed at $1,425.00 instead of $3,550.00. That is why selling losing positions to offset gains, often called tax-loss harvesting, can pay. If you buy the same or a substantially identical security within 30 days before or after the loss sale, the wash-sale rule postpones the loss.

On the Tax on a sale tool, a single sale at a loss shows the same logic. Selling the example position for $15,000 gives a $5,000.00 loss: with no other gains, $3,000.00 is deductible this year and $2,000.00 carries forward.

What this calculator does not include

  • Exact MAGI. The NIIT uses an estimate of MAGI from your inputs; your return may differ.
  • Special rates for collectibles, unrecaptured section 1250 gain and qualified small business stock.
  • The home sale exclusion, depreciation recapture on business property and installment sales.
  • Alternative minimum tax, credits and income-based phase-outs that a gain can trigger.
  • State rules. A few states tax gains differently from wages; one flat rate is an approximation.

To work out the cost basis of shares bought at different times, use the cost basis calculator, and for dividend income the dividend tax calculator.

Frequently asked questions

How much tax will I pay on capital gains?
It depends on how long you held the investment and on your other income. Gains on assets held more than a year are taxed at 0%, 15% or 20% federally; gains on assets held a year or less are taxed at your ordinary income tax rate. In the example, the long-term gain of $11,960.00 costs $2,392.00 including state tax, against $3,229.20 if it were short-term.
What is the capital gains tax rate for 2026?
For a single filer, long-term gains are taxed at 0% while total taxable income stays at or below $49,450, at 15% above that, and at 20% above $545,500. For married couples filing jointly the thresholds are $98,900 and $613,700. Short-term gains use the ordinary income tax brackets.
How long do I need to hold a stock for long-term capital gains?
More than one year. The holding period starts the day after you buy and includes the day you sell, so shares bought on March 10 become long-term if sold on March 11 of the following year or later. Selling on the one-year anniversary itself still counts as short-term.
How much capital loss can I deduct?
Capital losses first offset capital gains in full. If losses are left over, up to $3,000 a year ($1,500 if married filing separately) can be deducted from ordinary income. The rest carries forward to future years with no expiry, keeping its short-term or long-term character.
Do I pay state tax on capital gains?
In most states, yes. Most states with an income tax treat capital gains as ordinary income with no special rate for long-term gains, and a few states have no income tax at all. Enter your state's rate, or 0, in the calculator.

Related calculators

All calculators →

Check the numbers for real companies

All stocks →

This calculator is for education and planning. It uses the formulas described above and the inputs you provide; real results depend on fees, taxes, timing and other details that a general tool cannot know. PromtFinance does not give personal financial advice. Check important decisions with your provider or a qualified professional.