Home / Crypto & Blockchain / Wallet, Security & Tax / Crypto Capital Gains Tax

Formula & Calculator

Crypto Capital Gains Tax

In most countries, selling crypto for a profit is a taxable event. This formula estimates the tax owed: (sale price minus cost basis) times tax rate. For example, buying BTC for 10,000 and selling for 15,000 with a 20% tax rate gives 1,000 tax due. Tax rules vary widely by country, and some have different rates for short vs long-term gains. Keeping detailed records is essential for compliance. It is a key calculation for crypto investors.

Crypto Tax Daily Life
VORZEP · CRYPTO TAX TOOLS

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.

Tax = ( Sale Price − Cost Basis ) × Tax Rate
Quantity Sold How many units of the asset you disposed of. Capital gains are computed per unit and then multiplied by the quantity, so this scales the gain and the tax linearly. If you sold only part of a position, enter just the units sold — the remaining units keep their original cost basis and holding period. Under FIFO (the default in most jurisdictions) the oldest lots are deemed sold first, which usually means the lowest cost basis and the largest gain.
units
Quantity must be greater than zero.
= 1.00000000 units = 1.000 × 10⁰
Solve for
Sale Price per Unit The price at which you disposed of each unit in your reporting currency. For a sale on an exchange, use the executed price net of trading fees — fees reduce proceeds and therefore reduce the taxable gain. For a swap or spend, use the fair market value of the asset given up at the moment of the transaction, since most jurisdictions treat a swap as a disposal at FMV. Do not use the original purchase price here; that belongs in the cost basis field.
USD / unit
Sale price must be zero or greater.
= $50,000.00 = 5.000 × 10⁴ USD
Cost Basis per Unit The price you originally paid for each unit, plus any costs of acquisition that your jurisdiction allows you to capitalise — brokerage commissions, exchange fees, and sometimes gas for on-chain purchases. For assets received as income (staking, airdrops, mining, salary), the cost basis is the fair market value on the day you received them, which is also the amount you already reported as ordinary income. For inherited assets in the US, the basis is stepped up to the FMV on the date of death.
USD / unit
Cost basis must be zero or greater.
= $20,000.00 = 2.000 × 10⁴ USD
Tax Rate The rate that applies to your gain. In the US, short-term gains (held 365 days or less) are taxed at ordinary income rates — 10% to 37% depending on bracket — while long-term gains get preferential rates of 0%, 15%, or 20% plus the 3.8% Net Investment Income Tax above certain thresholds. The UK charges 10% or 20% for capital gains. Canada includes 50% of the gain in taxable income. Germany exempts gains on holdings over one year entirely. Enter the effective rate that applies to your situation.
%
Tax rate must be between 0 and 100.
= 15.00% = 0.150000 decimal = long-term rate
Tax Liability The tax owed on the disposal. It is computed on the gain, not on the proceeds — if you bought at $20,000 and sold at $50,000, only the $30,000 gain is taxed, not the full $50,000. A loss produces no tax and instead generates a capital loss that can offset other gains in the same year and, in most jurisdictions, be carried forward to future years. In the US, up to $3,000 of net capital loss can be deducted against ordinary income each year.
USD
Tax cannot be negative — a loss produces zero tax.
= $4,500.00 = 4.500 × 10³ USD = 15.00% of gain
Holding period — short vs long term HELPER
days
term

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.

Held 400 days → LONG-TERM → typical rate 0% / 15% / 20% (+3.8% NIIT where applicable).
Loss offset & carryforward HELPER
USD
USD

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.

No loss to offset — this disposal produced a gain.
Net proceeds after tax HELPER
USD
USD

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.

Proceeds $50,000.00 · tax $4,500.00 · net $45,500.00 (91.00% of proceeds).
TAX LIABILITY
4,500.00 USD
Gain $30,000.00 × 15.00% = $4,500.00 · long-term
LONG-TERM GAIN — PREFERENTIAL RATES
Tax = ( Sale Price − Cost Basis ) × Qty × Rate
Basis
Net gain
Tax
$20,000.00cost basis returned $25,500.00net gain after tax $4,500.00tax paid
Proceeds $50,000.00 · gain $30,000.00 · tax $4,500.00
Step-by-step solution
Tax vs. sale price
Current cost basis Basis × 0.5 Basis × 1.5
Tax vs. tax rate
Current gain Gain × 0.5 Gain × 2.0
Sensitivity
Companion tax metrics
Capital gain & tax — live schematic
CAPITAL GAINS TAX · TAX = ( SALE − BASIS ) × QTY × RATE SALE PRICE / UNIT $50,000.00 COST BASIS / UNIT $20,000.00 − GAIN / UNIT $30,000.00 × QTY 1 TOTAL GAIN $30K TAX RATE 15.00% × TAX LIABILITY $4,500.00 Tax = ($50,000.00 − $20,000.00) × 1 × 15.00% = $4,500.00 TAX TIMELINE — ACQUISITION → HOLDING PERIOD → SALE ACQUIRED basis $20,000 HOLDING PERIOD 400 days (long-term) SOLD +$30,000 gain
Sale price (disposal proceeds per unit) Cost basis (what you paid, returned to you tax-free) Gain — the only amount that is taxed Tax rate applied to the gain
What the capital gains tax relation really measures
Taxtax liability
=
( Psale − B )gain per unit
×
Qquantity
×
rtax rate

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

units
USD / unit
USD / unit
%
USD
USD
USD
= gain $30,000.00 × 15.00% = $4,500.00 tax · proceeds $50,000.00 · net $45,500.00 · effective rate on proceeds 9.00%

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.

JurisdictionShort-termLong-termLong-term thresholdNotes
United States10–37% (ordinary)0 / 15 / 20%> 365 daysPlus 3.8% NIIT above $200K/$250K MAGI; brackets depend on taxable income
United Kingdom10–20%10–20%No distinctionNo holding-period distinction; £3,000 annual exemption; rate depends on income band
Canada50% inclusion50% inclusionNo distinctionHalf of the gain is added to taxable income and taxed at marginal rate
AustraliaMarginal rate50% CGT discount> 12 monthsIndividuals get a 50% discount on gains for assets held over a year
GermanyMarginal rate0%> 12 monthsGains on crypto held over one year are entirely tax-free
Portugal28%28%No distinctionFlat 28% on crypto gains since 2023; previously tax-free
Switzerland0% (private)0% (private)—No capital gains tax for private investors; professional traders taxed as income
Singapore0%0%—No capital gains tax; gains taxed as income only if trading is habitual
UAE0%0%—No personal income tax; corporate tax at 9% for business activities
El Salvador0%0%—Bitcoin-related gains exempt under 2021 Bitcoin Law
France30% flat30% flatNo distinctionSingle flat rate combining income tax and social charges
Japan~20%~20%No distinctionMiscellaneous income; progressive rates up to 55% for high earners

Variable Reference

SymbolMeaningTypical rangeUnits
PsaleSale price per unit0 – 10⁶USD / unit
BCost basis per unit0 – 10⁶USD / unit
QQuantity sold10⁻⁸ – 10⁹units
rTax rate0 – 55%
Gain( Psale − B ) × Q−10⁶ – 10⁹USD
TaxGain × r ÷ 1000 – 10⁹USD
tHolding period0 – 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:

Tax = ( Sale Price − Cost Basis ) × Quantity × Tax Rate

The middle term is the total gain, which can be positive or negative:

Gain = ( Sale Price − Cost Basis ) × Quantity

Rearranged to solve for the other three unknowns:

Sale Price = Cost Basis + Tax ÷ ( Quantity × Rate )
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:

Tax = max( 0, Gain × Rate )

The net proceeds and the effective rate on proceeds follow directly:

Proceeds = Sale Price × Quantity
Net after tax = Proceeds − Tax
Effective rate on proceeds = Tax ÷ Proceeds × 100

Capital Gains Variables

SymbolMeaningNotes
PsaleSale price per unitExecuted price net of trading fees; FMV at disposal for swaps
BCost basis per unitOriginal purchase price plus capitalisable acquisition costs
QQuantity soldScales the gain linearly; FIFO determines which lots are sold
rTax rateOrdinary rate for short-term, preferential rate for long-term
GainTotal capital gain or loss( Psale − B ) × Q; negative means a loss
tHolding periodOver 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

Given: Sale = $50,000, Basis = $20,000, Qty = 1, Rate = 15% — solve for Tax
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%
Given: Tax = $4,500, Basis = $20,000, Qty = 1, Rate = 15% — solve for Sale Price
Gain needed = 4,500 ÷ 0.15 = $30,000
Sale = 20,000 + 30,000 = $50,000.00
Given: Tax = $4,500, Sale = $50,000, Qty = 1, Rate = 15% — solve for Cost Basis
Gain = 4,500 ÷ 0.15 = $30,000
Basis = 50,000 − 30,000 = $20,000.00
Given: Tax = $4,500, Sale = $50,000, Basis = $20,000, Qty = 1 — solve for Rate
Gain = $30,000
Rate = 4,500 ÷ 30,000 × 100 = 15.00%
Given: Sale = $15,000, Basis = $20,000, Qty = 1, Rate = 15% — a loss
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
Given: Sale = $50,000, Basis = $20,000, Qty = 1 — short-term vs long-term
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.

Calculating...

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
Scenario: An investor sells crypto for $15,000 with a cost basis of $10,000, realising a $5,000 gain. At a 15% tax rate, tax owed = 5000 × 0.15 = $750. The investor calculates this to set aside funds for tax payment and avoid penalties.
ParameterValue
Sale Price$15,000
Cost Basis$10,000
Tax Rate15%
1Gain = 15000 - 10000 = $5,000
2Tax = 5000 × 0.15 = $750
Result $750 ✓ Tax owed
Scenario: Another trade results in a loss: sale $8,000, cost basis $10,000. Gain = -$2,000. No tax is owed; the loss can offset other gains. The investor uses this to harvest tax losses and reduce their overall tax liability.
ParameterValue
Sale$8,000
Cost Basis$10,000
Rate15%
1Gain = 8000 - 10000 = -$2,000
2Tax = $0 (loss)
Result $0 ✓ No tax
Insight: Capital gains tax is calculated on the profit from a sale. Losses can offset gains, and tax rates vary by holding period and jurisdiction. Proper record‑keeping is essential.

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

Suggest an improvement

Found a mistake? Have a better example? Let us know.
You may send up to 3 suggestions per 24 hours.

Page details

1,149

Views
  • Published July 15, 2026
  • Last updated August 26, 2026