Capital Gains Calculator

Calculate capital gain or loss on an investment and the tax at a rate you supply.

Please note: A general estimate, not tax advice. Capital gains rules, rates and allowances vary substantially by country and change frequently. Consult a qualified tax professional.

What the Capital Gains Calculator does

A capital gain is the difference between what you sell an asset for and what it cost you, including transaction costs. Tax typically applies only to the amount above any annual allowance, and losses can usually be set against gains.

Formula

  • Cost basis = Purchase price × Quantity + Costs
  • Capital gain = Sale proceeds − Cost basis
  • Taxable gain = max(0, Gain − Allowance)
  • Tax = Taxable gain × Tax rate

Inputs explained

InputUnitRequiredNotes
Purchase price per unitselected currencyYesAccepts more than 0.
Sale price per unitselected currencyYesAccepts 0 or more.
QuantitynumberYesAccepts more than 0.
Buying and selling costsselected currencyOptionalAccepts 0 or more.
Capital gains tax rate%Optional
Tax-free allowanceselected currencyOptionalAccepts 0 or more.
Currencyone of 10 optionsOptional

How to use it

  1. Choose Currency.
  2. Enter Purchase price per unit, Sale price per unit and Quantity.
  3. Optionally add Buying and selling costs, Capital gains tax rate and Tax-free allowance.
  4. Select Calculate.

Worked example

300 shares bought at $40, sold at $67, $30 of costs, 15% tax, $3,000 allowance.

Purchase
40
Sale
67
Quantity
300
Costs
30
Rate
15
Allowance
3000

Cost basis $12,030, proceeds $20,100, gain $8,070, taxable $5,070, tax $760.50.

Frequently asked questions

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

Most systems tax assets held beyond a threshold — often a year — at a lower rate. Selling just before that threshold can be an expensive mistake.

Can I use losses to reduce tax?

Generally yes. Losses offset gains in the same year and often carry forward. Some jurisdictions have wash-sale rules preventing you from immediately repurchasing the same asset.

Related calculators