Capital Gains Tax Calculator

Sell something for more than you paid and the profit is a capital gain. How much tax you owe depends on two things: how long you held it, and how much other income you have.

This calculator applies the current federal brackets, including the 3.8% net investment income tax that applies above the income thresholds. State tax is not included.

Your expected filing status for the year of the sale.

$

Wages, interest and other ordinary income, before the standard deduction. This fills the lower tax brackets first, which is what pushes your gain into a higher rate.

$

What you originally paid, plus any reinvested dividends or improvements. A higher basis means a smaller gain.

$

What you sold it for, before selling costs.

Held one year or less and the gain is taxed as ordinary income — often at roughly double the long-term rate.

Results

Capital gain
$30,000.00
Other taxable income After the standard deduction. This fills the lower brackets first.
$58,900.00
Federal tax on the gain
$4,500.00
Net investment income tax (3.8%)
$0.00
Total federal tax
$4,500.00
You keep
$25,500.00
Effective rate on the gain
15%
Rate on your last dollar of gain Includes the 3.8% NIIT where it applies. This is the rate that matters for timing decisions.
15%

Calculated in your browser. Nothing is uploaded.

Your gain does not start at zero

The most common misunderstanding about capital gains tax is that your gain gets its own set of brackets starting from zero. It does not. Your other income fills the lower brackets first, and the gain stacks on top of whatever is left.

On the default figures here — $75,000 of other income, single filer — the standard deduction leaves $58,900 of taxable income. The 0% long-term bracket ends at $49,450, so your other income has already used it up entirely. That means all $30,000 of gain lands in the 15% band, and the bill is $4,500.

Change the other income to zero and the same $50,000 gain produces a tax bill of $82.50. Almost all of it falls inside the 0% band, and only $550 spills into 15%. Same gain, same rates — a hundred times less tax, purely because of what sits underneath it.

The one-year line is worth more than any other decision

Hold an asset for one year or less and the gain is taxed as ordinary income. Hold it for a year and a day and it gets the preferential rates. Nothing else you do moves the bill as much as crossing that line.

These are the numbers at $150,000 of other income, single filer:

  • $10,000 gain — $1,500 long-term against $2,400 short-term.
  • $50,000 gain — $7,500 against $12,000.
  • $100,000 gain — $16,900 against $28,470.
  • $250,000 gain — $45,100 against $86,000.

At the largest size the difference is $40,900, which is more than most people save in a year. And it hinges on one day: the holding period runs from the day after you buy through the day you sell, so buying on 1 March 2025 means the earliest long-term sale is 2 March 2026.

This does not mean you should hold a losing position for tax reasons — a bad investment does not become good because the tax rate improves. But when you are already close to the line, waiting is usually the cheapest decision available.

The 0% bracket is the biggest planning opportunity

If your taxable income stays inside the 0% band, long-term gains are taxed at nothing at all. Because the band is generous — up to $49,450 for a single filer and $98,900 for a married couple — a low-income year turns into a nearly free window for selling appreciated assets.

Here is a $50,000 long-term gain at different levels of other income, single filer:

  • No other income — $82.50 of tax, an effective rate of 0.17%.
  • $20,000 of other income — $667.50, about 1.33%.
  • $40,000 — $3,667.50, about 7.33%.
  • $60,000 — $6,667.50, about 13.33%.
  • $80,000 — $7,500, the full 15%.

The rate climbs gradually rather than jumping, because each extra dollar of other income pushes a little more of the gain out of the 0% band. That gradual slope is the whole mechanism, and it is why the effective rate on a gain is usually well below the headline rate people quote.

The practical version of this: if you have a year with unusually low income — early retirement, a sabbatical, a gap between jobs, a year you took losses — that is the year to realise gains. The tax rate on the same sale can differ by fifteen percentage points depending on which year you do it in.

The 3.8% that catches high earners

Above the thresholds, an additional 3.8% net investment income tax applies on top of the regular capital gains rate. It is calculated on the lesser of your net investment income or the amount by which your income exceeds the threshold — so it is not automatically 3.8% of everything.

The thresholds are $200,000 for single filers and $250,000 for joint filers, and they have not moved since the tax took effect in 2013. They are not adjusted for inflation, which means more taxpayers cross them every year even without a real increase in income.

At the top end the combination reaches 23.8%: the 20% long-term rate plus 3.8%. You can see it in the marginal rate output — at $500,000 of other income with a $200,000 gain, the last dollar of gain is taxed at 23.80%.

One consequence worth knowing: because the tax applies to the amount you exceed the threshold by, spreading a large sale across two tax years can keep more of it below the line. This calculator models a single year — run both years separately to see the difference.

Cost basis is the part you actually control

Your gain is the sale price minus your basis, and basis is where most of the avoidable tax lives. For assets bought in pieces — reinvested dividends, dividend reinvestment plans, stock acquired over years — the real basis is often higher than people assume, and every dollar of basis you cannot document is a dollar you pay 15% or 20% on unnecessarily.

It works the other way too. A $10,000 reduction in basis is not a $10,000 loss — it is roughly $1,500 to $2,380 of extra tax, depending on your bracket. That asymmetry is why keeping records matters more for tax than for any other purpose.

What this calculator leaves out

This is federal tax only, and several categories follow different rules entirely.

  • State and local tax, which ranges from zero to well over 10% depending on where you live.
  • Capital losses, which offset gains dollar for dollar. Up to $3,000 of net loss beyond that can offset ordinary income each year, with the rest carried forward.
  • The wash-sale rule, which disallows a loss if you buy a substantially identical asset within 30 days before or after the sale.
  • Collectibles, which are taxed at 28%, and qualified small business stock, which can be entirely exempt.
  • Depreciation recapture on real estate, which is taxed at up to 25% and applies even to gain that would otherwise be excluded.
  • The alternative minimum tax, credits, and any itemised deductions beyond the standard one.

How this calculator works

Long-term gains are taxed at 0%, 15% or 20% depending on total taxable income, and crucially the gain stacks on top of your ordinary income rather than starting from zero. Short-term gains are taxed as ordinary income. Above the income thresholds, the 3.8% net investment income tax applies to the lesser of your gain or the amount you exceed the threshold by.

LTCG tax = Σ (portion of gain in each bracket × 0% / 15% / 20%)

Variables

SymbolMeaningUnit
GainSale price minus cost basisUSD
Ordinary taxableOther income after the standard deductionUSD
NIITNet investment income tax3.8% × min(gain, MAGI − threshold)

Assumptions this calculation makes

  • Uses 2026 federal figures (IRS Rev. Proc. 2025-32).
  • State and local tax is not included — it can be substantial depending on where you live.
  • Assumes no capital losses to offset the gain. Losses reduce gains dollar for dollar.
  • The standard deduction is applied to other income; itemized deductions are not modelled.
  • Collectibles, qualified small business stock and real estate depreciation recapture all follow different rules and are not modelled here.
  • Wash-sale rules, carried-forward losses and prior-year items are not included.

Frequently asked questions

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

Assets held one year or less produce short-term gains, taxed at your ordinary income rates — up to 37%. Assets held longer than a year qualify for the 0%, 15% and 20% long-term rates. On a large gain the difference can exceed $40,000.

When does the holding period actually start?

The day after you buy, running through the day you sell. Buy on 1 March 2025 and the earliest long-term sale date is 2 March 2026. One day can be worth thousands.

Do I pay capital gains tax if my income is low?

Often not. If your taxable income stays within the 0% band — up to $49,450 single or $98,900 joint — long-term gains are taxed at zero. A low-income year is the cheapest possible time to realise gains.

What is the 3.8% net investment income tax?

An additional tax on investment income above $200,000 single or $250,000 joint. It applies to the lesser of your investment income or the amount you exceed the threshold by, so it phases in rather than hitting all at once.

Do capital losses reduce my gains?

Yes, dollar for dollar. Beyond that, up to $3,000 of net loss can offset ordinary income each year, with the remainder carried forward indefinitely. This calculator assumes no losses are being applied.

What is the wash-sale rule?

If you sell at a loss and buy a substantially identical asset within 30 days before or after, the loss is disallowed for that year and instead added to the basis of the new holding. It defers the loss rather than eliminating it.

Does state tax apply as well?

Almost always, and it is not included here. Rates range from zero in several states to over 10%, and some states tax capital gains as ordinary income with no preferential rate.

How is crypto taxed?

The IRS treats it as property, so the same capital gains rules apply — including the one-year line. Every disposal, including crypto-to-crypto trades, is a taxable event.