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 + CostsCapital gain = Sale proceeds − Cost basisTaxable gain = max(0, Gain − Allowance)Tax = Taxable gain × Tax rate
Inputs explained
| Input | Unit | Required | Notes |
|---|---|---|---|
| Purchase price per unit | selected currency | Yes | Accepts more than 0. |
| Sale price per unit | selected currency | Yes | Accepts 0 or more. |
| Quantity | number | Yes | Accepts more than 0. |
| Buying and selling costs | selected currency | Optional | Accepts 0 or more. |
| Capital gains tax rate | % | Optional | — |
| Tax-free allowance | selected currency | Optional | Accepts 0 or more. |
| Currency | one of 10 options | Optional | — |
How to use it
- Choose Currency.
- Enter Purchase price per unit, Sale price per unit and Quantity.
- Optionally add Buying and selling costs, Capital gains tax rate and Tax-free allowance.
- 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.