Crypto Capital Gains Tax Calculator
Solve the capital gains relation Tax = ( Sale Price − Cost Basis ) × Quantity × Tax Rate for any of its four unknowns — the tax due, the sale price, the cost basis, or the effective tax rate — with step-by-step math, a live gain-and-tax schematic, short-term vs long-term classification, and loss-offset analysis.
In the US and most other jurisdictions with a long-term distinction, the position must be held for more than 365 days to qualify for preferential capital gains rates. The holding clock starts on the day after acquisition and ends on the day of disposal. Enter your holding period to see the classification and the typical rate range that applies.
If this disposal produces a loss, it can offset other capital gains realised in the same tax year. In the US, up to $3,000 of remaining net loss can be deducted against ordinary income each year, with the rest carried forward indefinitely. In Canada and the UK similar offset and carryforward rules apply, though the mechanics differ.
Gross proceeds = sale price × quantity. Net after tax = proceeds − tax liability. This is the cash you actually keep once the tax authority has taken its share. On a profitable long-term disposal the tax is a fraction of the gain; on a short-term disposal it can be a large fraction, which is why the holding period matters so much.
Only the gain is taxed, not the proceeds
The single most common error in crypto tax is treating the full sale proceeds as taxable. They are not. Your cost basis is returned to you tax-free — it is your own capital coming back. Only the difference between the sale price and the cost basis is a gain, and only that gain is multiplied by the rate. Sell at $50,000 something you bought for $20,000 and you are taxed on $30,000, not $50,000. This distinction matters enormously at high rates and is the reason basis tracking is the foundation of every crypto tax calculation.
Holding period can halve your tax
In the US and most other jurisdictions with a long-term distinction, holding an asset for more than 365 days can cut the effective rate dramatically. A top-bracket taxpayer pays 37% on short-term gains but 20% on long-term gains — nearly half. Adding the 3.8% NIIT brings the long-term rate to 23.8%, still far below the ordinary rate. The holding clock starts the day after acquisition and runs to the day of disposal. Waiting an extra few weeks to cross the one-year threshold is one of the highest-return decisions in personal tax planning.
Losses are an asset, not just a setback
A capital loss is not wasted — it can offset capital gains realised in the same tax year, reducing the tax on your winners. In the US, up to $3,000 of net capital loss can be deducted against ordinary income each year, and the remainder carries forward indefinitely. This creates a legitimate planning opportunity: selling a losing position before year-end to realise the loss, then using it to shelter gains elsewhere. The wash sale rule prevents you from buying back the same asset within 30 days, but crypto's classification as property has historically left some ambiguity here that varies by jurisdiction.
Every swap is a taxable disposal
In the US and most other jurisdictions, trading one crypto for another is a taxable event even though no fiat ever leaves your account. Swapping ETH for a token is treated as selling ETH at its fair market value and buying the token with the proceeds. The gain on the ETH is realised and taxable. This catches many traders off guard because it produces a tax liability with no cash to pay it. The same applies to spending crypto on goods or services, and to using crypto to pay fees in some cases. Track every trade, not just every withdrawal to a bank.
How to Use This Calculator
The capital gains relation links four quantities: the tax liability, the sale price, the cost basis, and the tax rate, scaled by the quantity sold. Pick which one you want the tool to solve, then fill in the others.
1. Enter the quantity sold
Quantity is always required and scales everything else linearly. If you sold only part of a position, enter the units disposed of. Under FIFO the oldest lots are deemed sold first, which usually means the lowest basis and the largest gain.
2. Choose what to solve for
Pick Tax, Sale Price, Cost Basis, or Rate from the toggle. The calculator rearranges the formula automatically for whichever variable you choose and greys out that field.
3. Get the cost basis right
The cost basis is what you originally paid, plus capitalisable acquisition costs. For assets received as income — staking, airdrops, mining — it is the fair market value on the day of receipt, which is also the amount you already reported as ordinary income. This is not a double tax; the income event and the capital gain are separate.
4. Classify the holding period
Enter the number of days held. Over 365 days qualifies as long-term in the US and most jurisdictions, unlocking preferential rates. The helper shows the classification and the typical rate range so you can pick the right rate for the rate field.
5. Check the proceeds breakdown
The result card shows a three-segment bar splitting the proceeds into returned cost basis, net gain after tax, and tax paid. The loss-offset helper shows how a loss can shelter other gains, and the net-proceeds block shows what you actually keep.
6. Switch to Advanced for depth
Advanced mode adds a tax-vs-rate chart, a sensitivity check on ±1% input changes, and companion metrics including effective tax rate on proceeds, gain as a percentage of proceeds, tax per unit sold, and the price needed to hit a target after-tax amount.
What This Tool Offers
Built around the capital gains identity Tax = ( Sale Price − Cost Basis ) × Quantity × Tax Rate, the calculation every crypto disposal requires.
Four-way solving
Solve for the tax liability, the sale price, the cost basis, or the effective tax rate. The calculator rearranges the formula for whichever variable you choose.
Holding period classifier
Enter the days held to see short-term vs long-term classification and the typical rate range that applies in your jurisdiction.
Loss offset analysis
If the disposal produces a loss, see how it offsets other capital gains and how much remains available to carry forward.
Net proceeds breakdown
Gross proceeds, tax liability, and net after tax — plus a three-segment bar showing how the proceeds split between returned capital, net gain, and tax.
Dual comparison charts
Tax vs. sale price for three cost bases, plus an advanced tax-vs-rate chart for three gain levels.
Reference tables
A live tax converter, a tax lookup grid across gains and rates, typical rates by jurisdiction and holding period, and a full variable reference.
Reference Tables & Conversions
A live tax converter, a tax lookup grid across gains and rates, and typical rates by jurisdiction and holding period.
Sale · basis · gain · tax converter
Tax Lookup — Gain × Rate
Computed from Tax = Gain × Rate. Each cell shows the tax liability for a given gain and rate.
| Gain | @ 0% | @ 10% | @ 15% | @ 20% | @ 23.8% | @ 37% |
|---|
Typical Capital Gains Rates by Jurisdiction
Rates vary widely and change frequently. This is a general overview for planning purposes, not tax advice. Confirm current rules with a qualified adviser in your jurisdiction.
| Jurisdiction | Short-term | Long-term | Long-term threshold | Notes |
|---|---|---|---|---|
| United States | 10–37% (ordinary) | 0 / 15 / 20% | > 365 days | Plus 3.8% NIIT above $200K/$250K MAGI; brackets depend on taxable income |
| United Kingdom | 10–20% | 10–20% | No distinction | No holding-period distinction; £3,000 annual exemption; rate depends on income band |
| Canada | 50% inclusion | 50% inclusion | No distinction | Half of the gain is added to taxable income and taxed at marginal rate |
| Australia | Marginal rate | 50% CGT discount | > 12 months | Individuals get a 50% discount on gains for assets held over a year |
| Germany | Marginal rate | 0% | > 12 months | Gains on crypto held over one year are entirely tax-free |
| Portugal | 28% | 28% | No distinction | Flat 28% on crypto gains since 2023; previously tax-free |
| Switzerland | 0% (private) | 0% (private) | — | No capital gains tax for private investors; professional traders taxed as income |
| Singapore | 0% | 0% | — | No capital gains tax; gains taxed as income only if trading is habitual |
| UAE | 0% | 0% | — | No personal income tax; corporate tax at 9% for business activities |
| El Salvador | 0% | 0% | — | Bitcoin-related gains exempt under 2021 Bitcoin Law |
| France | 30% flat | 30% flat | No distinction | Single flat rate combining income tax and social charges |
| Japan | ~20% | ~20% | No distinction | Miscellaneous income; progressive rates up to 55% for high earners |
Variable Reference
| Symbol | Meaning | Typical range | Units |
|---|---|---|---|
| Psale | Sale price per unit | 0 – 10⁶ | USD / unit |
| B | Cost basis per unit | 0 – 10⁶ | USD / unit |
| Q | Quantity sold | 10⁻⁸ – 10⁹ | units |
| r | Tax rate | 0 – 55 | % |
| Gain | ( Psale − B ) × Q | −10⁶ – 10⁹ | USD |
| Tax | Gain × r ÷ 100 | 0 – 10⁹ | USD |
| t | Holding period | 0 – 10⁴ | days |
What Does Tax = ( Sale Price − Cost Basis ) × Quantity × Tax Rate Measure?
This relation computes the tax owed when you dispose of a crypto asset at a gain. It is one of the simplest formulas in personal taxation and also one of the most commonly miscalculated, because the two inputs that matter most — the cost basis and the holding period — are the ones people track least carefully. The formula taxes only the gain, not the proceeds, and applies a rate that depends on how long you held the asset before selling.
Capital Gains Tax Formula
The defining relationship is:
The middle term is the total gain, which can be positive or negative:
Rearranged to solve for the other three unknowns:
Cost Basis = Sale Price − Tax ÷ ( Quantity × Rate )
Tax Rate = Tax ÷ Gain × 100
When the gain is negative the disposal produces a capital loss and the tax is zero:
The net proceeds and the effective rate on proceeds follow directly:
Net after tax = Proceeds − Tax
Effective rate on proceeds = Tax ÷ Proceeds × 100
Capital Gains Variables
| Symbol | Meaning | Notes |
|---|---|---|
| Psale | Sale price per unit | Executed price net of trading fees; FMV at disposal for swaps |
| B | Cost basis per unit | Original purchase price plus capitalisable acquisition costs |
| Q | Quantity sold | Scales the gain linearly; FIFO determines which lots are sold |
| r | Tax rate | Ordinary rate for short-term, preferential rate for long-term |
| Gain | Total capital gain or loss | ( Psale − B ) × Q; negative means a loss |
| t | Holding period | Over 365 days usually qualifies for long-term rates |
How Each Variable Affects the Tax
Tax is linear in the gain and linear in the rate. Double the gain and you double the tax at the same rate; double the rate and you double the tax at the same gain. The gain itself is linear in quantity and in the spread between sale price and cost basis. Selling twice as many units doubles the gain; doubling the spread between what you paid and what you received also doubles the gain. These are all proportional relationships, which makes the formula easy to reason about and easy to stress-test.
The rate is where the structure of the tax system enters. In a jurisdiction with a long-term distinction, the same gain is taxed at a materially different rate depending on when you sell. In the US, a top-bracket taxpayer holding for 366 days pays 20% plus 3.8% NIIT — 23.8% — while the same taxpayer holding for 365 days pays 37%. That is a difference of 13.2 percentage points on the entire gain, purely from timing. On a $100,000 gain that is $13,200, which is why the holding period is the single most consequential variable in capital gains planning.
The cost basis is the variable that most people get wrong, and the errors run in both directions. Forgetting to include the acquisition fee understates the basis and overstates the tax. Failing to step up the basis for inherited assets overstates the gain. Using the wrong FMV for assets received as income — staking rewards, airdrops, mining — creates a mismatch between the income reported and the basis claimed, which is one of the most common findings in crypto tax audits. The basis is not an approximation; it is a specific number that must be documented for every lot you hold.
Losses work differently. A negative gain produces zero tax and a capital loss that can be used against other gains. In the US, a net capital loss of up to $3,000 per year can be deducted against ordinary income, and the remainder carries forward indefinitely. In Canada, net capital losses can be carried back three years and forward indefinitely. The UK allows losses to be offset against gains in the same year and carried forward. The asymmetry is deliberate: gains are taxed when realised, losses are only useful when realised against a gain, which is why year-end loss harvesting is a standard planning technique.
Capital Gains Tax Calculation Examples
Gain = (50,000 − 20,000) × 1 = $30,000
Tax = 30,000 × 0.15 = $4,500.00
Proceeds $50,000 · net after tax $45,500 · effective rate on proceeds 9.00%
Gain needed = 4,500 ÷ 0.15 = $30,000
Sale = 20,000 + 30,000 = $50,000.00
Gain = 4,500 ÷ 0.15 = $30,000
Basis = 50,000 − 30,000 = $20,000.00
Gain = $30,000
Rate = 4,500 ÷ 30,000 × 100 = 15.00%
Gain = (15,000 − 20,000) × 1 = −$5,000
Tax = $0.00 (no tax on a loss)
The $5,000 loss can offset other capital gains and, in the US, up to $3,000 of ordinary income
Gain = $30,000
Short-term at 37% = $11,100
Long-term at 20% = $6,000
Long-term at 23.8% (with NIIT) = $7,140
Holding past 365 days saves $3,960–$5,100 on the same gain
Frequently Asked Questions
Cost basis is what you originally paid for the asset, plus any costs of acquisition your jurisdiction allows you to capitalise. It is the number that gets subtracted from the sale price to determine the gain, and therefore the number that determines how much tax you owe. Buy at $20,000, sell at $50,000, and the gain is $30,000 — not $50,000. The basis is returned to you tax-free. Every dollar of basis you fail to claim is a dollar of extra tax, which is why keeping records of every acquisition is the foundation of crypto tax compliance. For assets received as income, the basis is the fair market value on the day you received them — which is also the amount you already reported as ordinary income.
In the US it can be the difference between paying 37% and paying 20% — plus the 3.8% Net Investment Income Tax above certain income thresholds, which brings the long-term rate to 23.8%. On a $100,000 gain, that is $37,000 versus $23,800, a saving of $13,200 for the same asset and the same gain. The threshold is more than 365 days: the clock starts the day after acquisition and runs to the day of disposal. Other jurisdictions differ. The UK has no holding-period distinction. Australia gives a 50% discount after 12 months. Germany exempts the gain entirely after one year. Canada includes 50% of the gain in income regardless of holding period. The planning implication is the same everywhere: check your jurisdiction's rule before selling.
In the US and most other jurisdictions, yes. A swap is treated as a disposal of the asset you gave up at its fair market value on the date of the exchange, followed immediately by a purchase of the new asset at that same value. If the asset you gave up had appreciated, the gain is realised and taxable — even though no fiat ever touched your account. This produces a tax liability with no cash to pay it, which is one of the classic pitfalls of active trading in crypto. The same rule applies to spending crypto on goods or services. A few jurisdictions treat certain like-kind exchanges favourably, but the US specifically excluded crypto from like-kind treatment in the 2017 tax reform.
A capital loss arises when you sell for less than your cost basis. It produces no tax — the tax is zero, not negative — and instead generates a loss that can be used against other capital gains. In the US, capital losses first offset capital gains in the same year. If losses exceed gains, up to $3,000 of the net loss can be deducted against ordinary income each year, and the remainder carries forward indefinitely. Canada allows net capital losses to be carried back three years and forward indefinitely. The UK allows losses to be offset against gains in the same year and carried forward. This is why year-end loss harvesting is standard practice: realising a losing position before the tax year ends creates a loss that shelters a gain elsewhere.
FIFO — first in, first out — is the default in most jurisdictions, including the US and Canada. It assumes the oldest lots are sold first, which in a rising market means the lowest cost basis and the largest gain. LIFO — last in, first out — sells the newest lots first, which in a rising market produces a smaller gain. Specific identification lets you choose exactly which lots to sell, which gives you the most control over the tax outcome. In the US, specific identification is permitted if you can identify the specific units sold and keep adequate records; most exchanges do not support it natively, so you need to maintain your own lot-level tracking. The choice can change the tax by thousands of dollars on the same disposal.
Yes, in most jurisdictions. The taxable event is the disposal, and a disposal includes selling for fiat, swapping for another crypto, spending on goods or services, and in some cases gifting to a non-spouse. Holding an appreciated asset is not a taxable event — unrealised gains are not taxed — but any transaction that changes what you own triggers a realisation. This is why someone who bought ETH in 2017 and held it ever since has no tax liability on the appreciation, while someone who traded actively between a dozen tokens has a tax liability for every profitable swap even if their bank account never saw a dollar. Unrealised appreciation is not income until it is realised.
For every acquisition, record the date, the quantity, the price per unit in your reporting currency, and any fees paid. For every disposal, record the date, the quantity, the sale price, and the fees. You also need to be able to match disposals to acquisitions under whatever basis method your jurisdiction requires. In practice this means a lot-level ledger: each purchase is a lot, each sale consumes one or more lots, and the cost basis of the consumed lots is what you subtract from the proceeds. Exchange CSV exports are often incomplete and do not include on-chain transactions, DeFi activity, or airdrops, so most people need a dedicated crypto tax tool or a spreadsheet that reconciles all sources. The record-keeping burden is the main reason crypto tax is more complex than securities tax.
Variables
| Symbol | Quantity | Unit |
|---|---|---|
| Tax Owed | Capital gains tax owed | currency |
| Sale Price | Price the crypto was sold for | currency |
| Cost Basis | Original purchase price plus fees | currency |
| Tax Rate | Applicable capital gains tax rate | % |
What it means
Crypto sales are taxable events. The capital gain is the difference between the sale price and the cost basis. The tax owed is the gain times the applicable tax rate. This is essential for tax reporting and for planning sales to minimise taxes. Understanding this helps investors manage their tax liability and to comply with regulations.
Worked example
Crypto Capital Gains Tax – Two Detailed Examples
Real‑World| Parameter | Value |
|---|---|
| Sale Price | $15,000 |
| Cost Basis | $10,000 |
| Tax Rate | 15% |
| Parameter | Value |
|---|---|
| Sale | $8,000 |
| Cost Basis | $10,000 |
| Rate | 15% |
Common mistakes
- Capital gains tax: (Sale price − Cost basis) × Tax rate.
- Sale price: The total proceeds from the sale.
- Cost basis: The original purchase price plus fees.
- Tax rate: Depends on holding period and jurisdiction (short‑term vs long‑term).
Applications
Crypto capital gains tax calculates the tax owed on a sale by subtracting the cost basis from the sale price and multiplying by the tax rate. This is essential for tax compliance in many jurisdictions. Investors and traders use it to estimate their tax liabilities and to plan their selling strategies. Understanding this calculation is crucial for avoiding penalties and for effective tax planning.
- Estimating tax liability on crypto gains
- Tax‑loss harvesting and strategic selling
- Reporting to tax authorities
- Planning for year‑end tax payments
- Educational understanding of crypto taxation
Related calculators · Wallet, Security & Tax
Recently updated formulas
Suggest an improvement
Found a mistake? Have a better example? Let us know.
You may send up to 3 suggestions per 24 hours.