Home › Finance & Money › Capital Gains Tax Calculator

Capital Gains Tax Calculator

Use this free capital gains tax calculator to estimate the tax on a profit from selling stocks, property, or another asset. Enter the gain, whether you held the asset for more than a year, your filing status, and your other taxable income, and it works out the tax at the 2026 rates, including the extra 3.8% net investment income tax when it applies.

Sale price minus what you paid (and minus selling costs).

Your taxable income before this gain — after deductions.

—
Enter your gain and income, then press Calculate tax.

Gain vs. tax

Blue: your gain. Light blue: the tax on it. The rest is what you keep.

How it works

When you sell an asset for more than you paid for it, the profit is a capital gain, and the tax on it depends mainly on one thing: how long you held the asset. Hold it for more than one year and the gain is long-term, taxed at the lower rates of 0%, 15%, or 20%. Hold it for one year or less and the gain is short-term, taxed at your ordinary income tax rates — the same rates as your salary — which are usually higher. That one-year line is the single most important decision in this whole topic, and it is why patient sellers often pay much less tax than quick sellers.

Capital gain is the sale price minus your cost basis — what you paid for the asset, plus buying costs, minus selling costs such as broker commissions. Only the profit is taxed, not the whole sale price. Other taxable income is your taxable income before this gain, after the standard deduction or itemized deductions. It matters because long-term gains stack on top of your other income: the 0% rate only covers the part of the gain that fits under the threshold once your other income is counted. A $10,000 gain on top of $40,000 of income is mostly taxed at 0%, but the same gain on top of $90,000 of income is taxed at 15%.

The 2026 long-term rates used here are 0%, 15%, and 20%. For single filers the 0% rate covers taxable income up to $49,850, the 15% rate covers income up to $533,400, and 20% applies above that. For married couples filing jointly the thresholds are $99,700 and $600,050; for married filing separately, $49,850 and $300,025; for heads of household, $66,750 and $566,750. These are the thresholds this calculator uses as its 2026 figures — they are estimates for planning, and the final IRS figures may differ slightly, so check them before filing. The standard deductions used for context are the same 2026 figures as our tax pages: $16,100 single, $32,200 married filing jointly, $16,100 married filing separately, and $24,150 head of household. Short-term gains are taxed with the 2026 ordinary brackets: for single filers, 10% up to $12,400, 12% up to $50,400, 22% up to $105,700, 24% up to $201,775, 32% up to $256,225, 35% up to $640,600, and 37% above that; married filing jointly brackets are 10% up to $24,800, 12% up to $100,800, 22% up to $211,400, 24% up to $403,550, 32% up to $512,450, 35% up to $768,700, and 37% above that.

Long-term tax = gain sliced across the 0% / 15% / 20% thresholds, stacked on top of your other taxable income. Short-term tax = tax on (other income + gain) − tax on other income, at ordinary brackets.

There is one extra tax to know about. The net investment income tax adds 3.8% on investment income, including capital gains, when your income is over $200,000 for single filers and heads of household, $250,000 for married couples filing jointly, or $125,000 for married filing separately. This calculator adds it on the smaller of your gain and the amount by which your income tops the threshold, and shows it as its own line so you can see exactly what it costs. It does not include state capital gains tax, which varies widely — some states tax gains as ordinary income and some have no income tax at all — so your total bill can be higher than the federal estimate shown here.

Worked example

Suppose you are a single filer with $40,000 of other taxable income, and you sell stock you held for two years at a $10,000 gain. Here is how the tax works out, step by step.

Step 1: The gain is long-term, because you held the stock for more than one year, so the 0% / 15% / 20% rates apply.
Step 2: Stack the gain on your other income. Your income before the gain is $40,000, and the 0% threshold for single filers is $49,850, so $9,850 of the gain ($49,850 − $40,000) fits in the 0% band and is taxed at $0.
Step 3: The remaining $150 of the gain ($10,000 − $9,850) falls in the 15% band, so the tax is $150 × 0.15 = $22.50.
Step 4: Your total income of $50,000 is far below the $200,000 net investment income tax threshold, so no 3.8% tax applies.
Step 5: The total tax on the gain is $22.50, and you keep $10,000 − $22.50 = $9,977.50 of it.

Enter the same numbers — $10,000 gain, long-term, single, $40,000 other taxable income — and the calculator shows exactly the same result: $22.50 tax on the gain, an effective rate of 0.23%. If the same gain were short-term instead, the tax would be about $1,200, because it would be taxed at your 12% ordinary rate — that is the real cost of selling before the one-year mark.

FAQ

What is the difference between short-term and long-term capital gains?

A gain is long-term if you held the asset for more than one year before selling it, and short-term if you held it for one year or less. Long-term gains are taxed at the lower 0%, 15%, or 20% rates, while short-term gains are taxed at your ordinary income tax rates, which are usually higher.

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

For 2026 this calculator uses 0% up to $49,850 of taxable income for single filers ($99,700 married filing jointly), then 15% up to $533,400 single ($600,050 married filing jointly), and 20% above that. These are the thresholds this calculator uses; they are estimates for planning and may differ slightly from the final IRS figures.

What is the 3.8% net investment income tax?

The net investment income tax is an extra 3.8% tax on investment income, including capital gains, when your modified adjusted gross income is over $200,000 for single filers or $250,000 for married couples filing jointly. This calculator adds it when your income is above the threshold and shows it as a separate line.

Do I pay capital gains tax if I sell at a loss?

No. A loss means there is no gain to tax, and capital losses can offset capital gains in the same year. If your losses are bigger than your gains, you can generally deduct up to $3,000 of the net loss against other income each year and carry the rest forward to future years.

How can I lower my capital gains tax?

The most common ways are holding assets for more than a year so the gain qualifies for the lower long-term rates, selling in a lower-income year when your bracket is lower, offsetting gains with capital losses, and using tax-advantaged accounts such as an IRA, where gains are not taxed when the asset is sold inside the account.

Disclaimer: This calculator gives estimates only, not financial advice. It uses 2026 federal long-term and ordinary tax rates and thresholds as planning figures, does not include state tax, and does not cover special cases such as collectibles, depreciation recapture, or the qualified small business stock exclusion. Talk to a qualified tax professional before making tax decisions.