networth
Markets open · Aug 6, 2026 12:23 PM ET S&P 500 7,704.32-0.25% Dow Jones 53,980.85-0.68% Nasdaq 26,306.73-0.22% 10-Yr Yield 4.67%+1.19% BTC/USD $64,550-0.08% Gold $4,292.50-0.29% Oil (WTI) $77.81+3.44% 30-Yr Mortgage 6.69%+0.03 Nat'l Avg Savings 0.38% APY Nat'l Avg 12-Mo CD 1.68% APY

Capital gains tax calculator

Selling an investment for more than you paid creates a taxable gain — but not at a single rate. Enter the sale below to see the tax across each band, the net investment income tax if it applies, and what you keep.

Reviewed by Troy Hanson, CFP®· Updated Aug 5, 2026· Free · No signup · Runs in your browser

The sale

$
$
$
$
%

What your capital gains result shows

The headline is the federal tax on the sale. Beneath it, a long-term gain is broken out by band, and that breakdown is the reason a single-rate estimate is so often wrong: a long-term gain is stacked on top of your other taxable income, so one sale can be taxed partly at 0% and partly at 15%, or partly at 15% and partly at 20%. Only the slice that lands above each threshold pays the higher rate.

Two more lines matter. The net investment income tax is a separate 3.8% that applies once income passes its own threshold, and it catches people who assumed 15% was the whole story. The effective rate divides the total tax by the gain, which is the number to compare against a headline bracket — it is almost always lower than the top rate you touched.

How to use this calculator

  1. Sale price and what you paid — the gap between them, less costs, is the gain. Getting the basis right matters more than anything else here.
  2. Selling costs — commissions and fees come off the gain, so include them.
  3. Holding period — more than a year is long-term. Switch between the two options to see what the difference is worth on your own numbers.
  4. Other taxable income — the gain stacks on top of this, which is what decides the bands it falls into. Use taxable income, after deductions, not gross salary.
  5. Marginal rate — your ordinary-income rate, used for short-term gains and for the hold-versus-sell comparison.

This estimates federal tax only. Most states tax capital gains as ordinary income, a handful do not tax them at all, and a few apply their own preferential rates.

How capital gains tax works

A capital gain is realised only when you sell. An investment that has doubled on paper is not taxed until you dispose of it, which is why holding is itself a tax strategy — unrealised growth compounds undisturbed.

Once you sell, the holding period decides which regime applies. Held a year or less, the gain is a short-term gain and is taxed as ordinary income at your marginal rate, exactly like salary. Held more than a year, it is a long-term gain and qualifies for the preferential 0%, 15% or 20% rates. The gap between the two is frequently the difference between keeping four fifths of a gain and keeping two thirds, and it turns on a single day of holding period.

Gains and losses are netted against each other before any tax is due, short against short and long against long. That is what makes deliberate loss-harvesting effective: selling a losing position in the same year as a winning one reduces the taxable gain directly, which also shows up in your net worth as a smaller tax drag rather than a smaller portfolio.

Long-term capital gains rates for 2026

For 2026 the long-term thresholds are taxable-income ceilings, and the rate applies only to the portion of the gain sitting above each one:

  • Single filers: 0% up to $49,450 of taxable income, 15% up to $545,500, then 20%.
  • Married filing jointly: 0% up to $98,900, 15% up to $613,700, then 20%.
  • Head of household: 0% up to $66,200, 15% up to $579,600, then 20%.
  • Married filing separately: 0% up to $49,450, 15% up to $306,850, then 20%.

Thresholds from the IRS Rev. Proc. 2025-32, the IRS inflation-adjustment release for 2026. Note what the 0% band means in practice: a taxpayer with modest ordinary income can realise a substantial long-term gain and owe nothing federally, which is the basis of deliberate gain-harvesting in low-income years.

Three special rates sit outside this structure. Collectibles such as art and coins are taxed at up to 28%, the taxable part of a gain on qualified small business stock at up to 28%, and unrecaptured depreciation on real property at up to 25%. This calculator models the ordinary 0/15/20 structure, not those exceptions.

The net investment income tax

On top of the capital gains rate, a further 3.8% applies to investment income once modified adjusted gross income passes a threshold: $200,000 for single filers and heads of household, $250,000 for married couples filing jointly, and $125,000 filing separately.

It is charged on the lesser of your net investment income and the amount by which your income exceeds the threshold, so a gain that pushes you just over the line is only partly exposed. These thresholds are set in statute and are not adjusted for inflation, which means they capture more taxpayers every year — a quiet tax increase that no legislation has to pass. Figures from IRS Topic 559.

What reduces the bill

  • Hold past a year. The most reliable lever there is, and the comparison line in the results prices it on your own numbers.
  • Harvest losses. Realised losses offset realised gains dollar for dollar. Beyond that, up to $3,000 a year can offset ordinary income and the remainder carries forward indefinitely. Watch the wash-sale rule: buying a substantially identical security within 30 days either side of the sale disallows the loss.
  • Use tax-advantaged accounts. Gains inside an IRA or 401(k) are not taxed on realisation at all — see the Roth IRA calculator for what that wrapper is worth over decades.
  • Time the year. Because the rate depends on total taxable income, realising a gain in a low-income year — a career break, early retirement before pensions start — can drop it into the 0% band entirely.
  • Check your basis. Reinvested dividends, stock splits and improvements to property all raise basis and cut the gain. Brokers do not always have complete records for older holdings.

On a primary residence a separate exclusion applies — up to $250,000 of gain for a single filer and $500,000 for a couple, subject to ownership and use tests — so a home sale is often not taxable at all.

What this calculator assumes

  • Federal tax only. State treatment varies widely and is not included.
  • One sale, in isolation. Real returns net all your gains and losses for the year together, which can change the answer substantially.
  • The standard 0/15/20 structure. Collectibles, qualified small business stock and unrecaptured depreciation have their own rates.
  • Taxable income as entered. The bands key off taxable income after deductions, so an estimate here shifts the answer.
  • No exclusions applied — the primary-residence exclusion and 1031 exchanges on investment property both sit outside this model.

These are planning estimates, not tax advice. A sale of any size is worth putting in front of a tax professional before you file — and often before you sell.

Capital gains questions people ask

Do I pay capital gains tax if I do not sell?

No. Gains are taxed only when realised, which is why leaving an appreciating investment alone defers tax indefinitely. Dividends and interest are taxed as they are paid, but growth in the price of an asset is not taxed until you dispose of it.

How is the one-year holding period measured?

From the day after you acquired the asset to the day you sold it. More than a year qualifies for long-term treatment, so a sale on the anniversary itself is still short-term — a single day can move the whole gain between two rate structures.

What if I sold at a loss?

Losses offset gains of the same type first, then the other type. If losses still exceed gains, up to $3,000 a year reduces ordinary income and anything beyond that carries forward to future years indefinitely.

Does selling my house trigger capital gains tax?

Often not. If it was your main home for at least two of the last five years, up to $250,000 of gain is excluded for a single filer and $500,000 for a married couple filing jointly. Gain above the exclusion is taxable at long-term rates.