Toolzent

Capital Gains Tax Calculator

Free capital gains tax calculator: enter your purchase price, sale price and tax rate to see your gain, the tax owed and your net profit after tax.

Updated 2026-06-09 · Free · No sign-up · Runs privately in your browser

Enter the rate that applies to you. US long-term gains are often 0/15/20%; short-term is taxed as ordinary income. Fees are added to your basis (buy) and deducted from proceeds (sell). With "Per unit", prices are multiplied by quantity.

What is a capital gains tax calculator?

A capital gains tax calculator works out the profit you made on selling an asset and how much tax you owe on that profit. You enter three numbers — the purchase price, the sale price and your tax rate — and it returns the capital gain, the tax due and your net profit after tax in one step.

A capital gain is the difference between what you paid for an asset and what you sold it for. It applies to stocks, ETFs, crypto, property, mutual funds, collectibles and most other investments. When you sell for more than you paid, the difference is a taxable gain; when you sell for less, you have a loss, which is not taxed by this tool. This page covers the math, worked examples and the common mistakes that throw the numbers off.

How is capital gains tax calculated?

The calculator uses three simple steps:

  • gain = sale price − purchase price
  • tax = gain × rate ÷ 100 (only when the gain is positive)
  • net profit after tax = gain − tax

The terms map to real-world figures like this:

  • Purchase price (cost basis): what you originally paid for the asset, in your currency.
  • Sale price (proceeds): the amount you received when you sold it.
  • Rate: your applicable capital gains tax rate, entered as a percentage (for example 15 for 15%).

The key rule is that tax is only charged on a positive gain. If the sale price is below the purchase price, the gain is negative — that is a loss — and the tax is 0. The tool never produces a “negative tax,” so a loss simply leaves you with a tax of 0 and a net result equal to the loss itself.

Whether your rate is the short-term (ordinary-income) rate or a lower long-term rate is up to you: enter the percentage that matches your holding period and jurisdiction. The calculator does not pick a rate for you.

Examples

Example 1: a taxable gain on a stock

You buy shares for 10,000 and later sell them for 15,000 at a 15% rate.

  1. gain = 15,000 − 10,000 = 5,000
  2. tax = 5,000 × 15 ÷ 100 = 750
  3. net profit after tax = 5,000 − 750 = 4,250

You keep 4,250 of the 5,000 profit, and 750 goes to tax.

Example 2: selling at a loss

You buy crypto for 8,000 and sell it for 6,000 at the same 15% rate.

  1. gain = 6,000 − 8,000 = −2,000 (a loss)
  2. Because the gain is not positive, tax = 0
  3. net result = −2,000 − 0 = −2,000

The 2,000 loss is not taxed. The calculator charges no tax whenever you sell below the purchase price.

Example 3: short-term vs long-term rate on the same trade

You buy an ETF for 20,000 and sell for 30,000, a gain of 10,000. Compare a short-term rate of 24% with a long-term rate of 15%.

  • Short-term: tax = 10,000 × 24 ÷ 100 = 2,400; net = 10,000 − 2,400 = 7,600
  • Long-term: tax = 10,000 × 15 ÷ 100 = 1,500; net = 10,000 − 1,500 = 8,500

Same gain, but the lower long-term rate leaves you 900 better off — which is why holding period matters.

Quick reference table

This table shows the tax and net profit for a fixed 5,000 gain across several rates, so you can sanity-check the calculator.

RateGainTax (gain × rate)Net profit after tax
0%5,00005,000
10%5,0005004,500
15%5,0007504,250
20%5,0001,0004,000
24%5,0001,2003,800

A loss (sale price under the purchase price) produces a tax of 0 at every rate, because only a positive gain is taxed.

Common uses

  • Stocks and ETFs: estimate the tax on a share sale before placing the trade.
  • Crypto: work out the tax on a disposal using your cost basis and proceeds.
  • Property and other assets: apply your relevant rate to a one-off sale to gauge the bill.
  • Trade comparison: test how a short-term versus long-term rate changes what you keep.
  • Net proceeds planning: see your after-tax profit so you know the real cash you walk away with.

Tips and common mistakes

  • Use net proceeds and full cost basis. Subtract selling fees from the sale price and add buying costs to the purchase price for a more accurate gain.
  • Match the rate to your holding period. Short-term gains are usually taxed as ordinary income; long-term gains often get a lower rate. Entering the wrong one skews the tax.
  • Remember losses are not taxed here. A sale below cost shows a loss and a tax of 0; the tool does not turn a loss into a refund.
  • Enter the rate as a percentage, not a decimal. Type 15 for 15%, not 0.15.
  • Calculate each lot separately if you bought at different prices, since each has its own cost basis.

Limitations and accuracy notes

This calculator applies a single flat rate to a single gain. It does not apply annual exemptions or allowances, tax-free thresholds, deductions, brackets, the netting of gains against losses across multiple sales, wash-sale rules, indexation, or different rates for different income bands. Real capital gains tax can be progressive and depends on your total income, filing status, holding period and country, and losses can often be carried forward or offset against other gains in ways this tool does not model. Treat the result as a quick estimate, not a filing figure, and confirm the rules and rates with your local tax authority or a qualified tax professional before acting. This page is for general information only and is not tax advice.

For more money tools, see the tax calculators category. The VAT calculator and GST calculator handle consumption taxes on prices, and the reverse sales tax calculator extracts a sales tax that is already baked into a total.

Frequently asked questions

How is capital gains tax calculated?+

Subtract the purchase price (cost basis) from the sale price to get the gain, then multiply that gain by your tax rate. Buy at 10,000, sell at 15,000 with a 15% rate: gain = 5,000 and tax = 750.

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

Short-term gains are on assets held a short period and are usually taxed as ordinary income; long-term gains are on assets held longer and often qualify for a lower rate. Enter whichever rate applies to you.

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

No. If the sale price is below the purchase price the gain is negative, so the calculator reports a loss and the tax is 0 — losses are not taxed.

What rate should I enter?+

Enter the percentage that applies to your situation — your long-term rate, your short-term/ordinary-income rate, or a flat crypto or stock rate set by your tax authority. The tool does not assume a rate for you.

How do I calculate capital gains tax on stocks?+

Use your net sale proceeds as the sale price and your total purchase cost as the cost basis, enter your applicable rate, and the tool returns the gain, tax and net profit after tax.

Does this calculator work for crypto?+

Yes. Crypto disposals follow the same gain = sale − purchase logic; enter the cost basis, the disposal value and your crypto capital gains rate.

What is net profit after tax?+

It is your gain minus the tax: net = gain − tax. On a 5,000 gain taxed at 15% (750 tax), the net profit after tax is 4,250.

Does the calculator account for exemptions or allowances?+

No. It computes the raw gain and tax at the rate you enter and does not apply annual exemptions, deductions, holding-period rules or local thresholds.