Skip to content

Capital Gains Tax Calculator

Estimate capital gains tax from your cost basis, sale price and holding period. Long-term gains use preferential rates; short-term gains are taxed as ordinary income — the calculator applies the right treatment for the selected year.

Written by the CalcBundle Research & Editorial Team · Reviewed by the Quality Review Team · Transparent formulas · results are estimates, not advice. · Updated

Tax information

Transaction
$
$
$
$
$
mo
Your income
$

Estimated capital gains tax

Enter a purchase and sale price.

Quick Answer

How is capital gains tax calculated?

US capital gains tax depends on two factors: your gain (sale price minus adjusted cost basis) and your holding period. Assets held over one year qualify for long-term rates: 0%, 15%, or 20%, based on taxable income. For 2025, single filers pay 0% on long-term gains if taxable income is below $48,350; 15% up to $533,400; 20% above that. High-income taxpayers may also owe the 3.8% Net Investment Income Tax (NIIT). Short-term gains — on assets held one year or less — are taxed as ordinary income at your marginal bracket, up to 37%. A $50,000 long-term gain for a single filer with $80,000 of other income lands in the 15% bracket, producing a $7,500 tax — versus up to $18,500 if the same gain were short-term. Your adjusted cost basis includes the purchase price plus commissions and capital improvements, so accurate records directly reduce your tax.

What a capital gains tax calculator does

When you sell an investment at a profit, part of that profit usually goes to tax — but how much depends on details many people overlook: your true cost basis, how long you held the asset, and where the gain lands on top of your other income. A capital gains tax calculator brings those factors together to estimate the tax and, just as usefully, your after-tax gain. It is the number that tells you what a sale is really worth, and it often reveals that holding a few weeks longer, or realising a loss elsewhere, changes the outcome significantly.

Working out the gain

  • Adjusted cost basis = purchase price + purchase costs + improvements
  • Adjusted proceeds = sale price − selling costs
  • Capital gain = adjusted proceeds − adjusted cost basis

The word adjusted is doing real work here. Commissions, transfer taxes and — for property — capital improvements all raise your basis, and every dollar added to basis is a dollar of gain you are not taxed on. Careless record-keeping that ignores these costs overstates the gain and the tax.

Why the holding period matters so much

Holding period decides everything about the rate. Sell within a year and the gain is short-term, taxed like a bonus at your ordinary marginal rate — potentially 35%+ for high earners. Hold for more than a year and the gain becomes long-term, taxed at the preferential 0%, 15% or 20% rates. On a large gain the difference between selling at eleven months and thirteen months can be tens of thousands of dollars, which is why the calculator asks for the holding period and switches treatment accordingly.

How long-term rates stack

Long-term gains are not taxed in isolation; they sit on top of your ordinary taxable income and then pass through the 0/15/20% brackets. If your other income already fills the lower band, more of the gain is pushed into the 15% or 20% band. This stacking is why two people with the same gain can owe different amounts, and why realising a gain in a low-income year can be far cheaper than in a high-income one.

Worked example

You buy shares for $20,000, pay $100 in commissions, and later sell them for $32,000 with $150 of selling costs, having held them for eighteen months. Your adjusted basis is $20,100 and your adjusted proceeds are $31,850, giving a long-term gain of $11,750. Because you held for more than a year, that gain is taxed at the 0/15/20% long-term rates for your income rather than your ordinary rate — and the calculator shows both the tax and the after-tax gain you keep.

Losses, timing and related tools

Capital losses offset gains and, within limits, ordinary income, so realising a loser to offset a winner is a legitimate way to lower the bill. To compare the pre-tax picture, use the stock profit calculator or investment return calculator; for a property sale, the real estate ROI calculator works out the gain before this tool estimates the tax on it.

Frequently asked questions

What is a capital gain?

A capital gain is the profit when you sell an asset — shares, a fund, property, crypto — for more than its adjusted cost basis, which is the purchase price plus purchase costs and any improvements. If the proceeds are lower than the basis, you have a capital loss instead, which can offset other gains.

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

It is entirely about holding period, and the tax difference is large. In the US, assets held one year or less are short-term and taxed as ordinary income at your marginal rate; assets held more than a year are long-term and taxed at preferential 0%, 15% or 20% rates. Waiting past the one-year mark can meaningfully cut the tax on the same gain.

How is the long-term rate determined?

Long-term gains stack on top of your other taxable income and pass through the 0/15/20% thresholds for your filing status and tax year. Because of the stacking, part of a single gain can be taxed at 0% and part at 15% if it straddles a threshold — the calculator handles that split rather than applying one flat rate.

Can capital losses reduce my tax?

Yes. Losses first offset gains of the same type, then the other type, and a limited amount of net loss can offset ordinary income each year, with the remainder carried forward. Deliberately realising losses to offset gains is known as tax-loss harvesting.

Do I owe tax on gains I have not sold?

Generally no. Capital gains tax is triggered by a sale (a realisation event); an investment that has risen in value but not been sold is an unrealised gain and is not taxed. This is why timing a sale — and the holding period at the moment you sell — is central to the tax you pay.

Is selling my home taxed the same way?

Often not. Many jurisdictions offer a primary-residence exclusion that shelters a large portion of the gain on a main home, and special rules apply to collectibles and certain property. This calculator estimates the general case; it does not model the home-sale exclusion or asset-specific rules, so treat those situations separately.

Sources & methodology

Formula
LTCG Tax = Gain × Long-term rate (0%, 15%, or 20% based on taxable income); STCG taxed as ordinary income at marginal rate; NIIT = 3.8% on lesser of net investment income or MAGI above threshold
Reviewed
September 2026

Primary sources

Calculation methodology is documented on our methodology page. Reviewed by the CalcBundle Quality Review Team.

Disclaimer. This calculator provides estimates for informational purposes only. Results are based on the information you enter and the assumptions used by the calculator. Actual financial, tax, business valuation, lending, marketplace or investment outcomes may differ. Consider consulting a qualified professional for decisions involving significant amounts of money. This estimate is for informational purposes only and is not tax or investment advice. State taxes and special rules (e.g. collectibles, primary-residence exclusions) are not modelled.