How to Calculate Crypto Gains and Losses

#crypto gains#crypto losses#capital gains crypto#crypto tax calculation#bitcoin taxes

Every crypto sale triggers a gain or loss calculation. The formula is simple — sale price minus cost basis — but tracking it across hundreds of transactions, multiple wallets, and token swaps gets complicated fast.

Estimate your crypto tax bill with the Crypto Tax Calculator.


The Basic Formula

Capital Gain (or Loss) = Sale Price − Cost Basis − Fees

TermMeaning
Sale priceWhat you received (in USD at time of sale)
Cost basisWhat you originally paid (in USD at time of purchase) + fees
FeesTrading fees, gas fees, network fees on both buy and sell

Example:

  • Bought 0.5 BTC for $25,000 (+ $50 exchange fee)
  • Cost basis: $25,050
  • Sold 0.5 BTC for $45,000 (− $50 exchange fee)
  • Net proceeds: $44,950
  • Capital gain: $44,950 − $25,050 = $19,900

Short-Term vs. Long-Term

The holding period determines your tax rate:

Holding PeriodClassificationTax Rate
1 year or lessShort-termOrdinary income rate (10-37%)
More than 1 yearLong-termPreferential rate (0%, 15%, or 20%)

The difference matters. On a $20,000 gain at the 24% bracket:

  • Short-term: $20,000 × 24% = $4,800 tax
  • Long-term: $20,000 × 15% = $3,000 tax
  • Saving: $1,800 by holding one extra day past 12 months

The holding period starts the day after acquisition. Buy on January 15, 2025 → long-term starts January 16, 2026.


Calculating Gains on Crypto-to-Crypto Trades

Swapping one crypto for another is treated as selling the first and buying the second.

Example — ETH to SOL swap:

StepAmount
Bought 10 ETH at $2,000 eachCost basis: $20,000
Traded 10 ETH for 400 SOL when ETH = $3,500Sale price: $35,000
Gain on ETH$15,000
Cost basis of 400 SOL$35,000 (fair market value at swap time)

You owe tax on the $15,000 ETH gain even though you never received cash. The SOL starts with a $35,000 cost basis for future calculations.


Handling Multiple Purchases

Most people buy crypto at different times and prices. When you sell, which purchase's cost basis do you use?

Cost basis methods:

MethodHow It WorksBest For
FIFO (First In, First Out)Sells oldest coins firstDefault method; simple
LIFO (Last In, First Out)Sells newest coins firstLower gains in rising markets
Specific IDYou choose which lot to sellMaximum tax optimization
HIFO (Highest In, First Out)Sells highest-cost coins firstMinimizes gains

FIFO example:

PurchaseAmountPrice EachCost Basis
Jan 20251 BTC$40,000$40,000
Jun 20251 BTC$60,000$60,000
Dec 20251 BTC$80,000$80,000

You sell 1 BTC for $90,000. Under FIFO, you sell the January lot first:

  • Gain: $90,000 − $40,000 = $50,000 (long-term)

Under Specific ID, you could sell the December lot:

  • Gain: $90,000 − $80,000 = $10,000 (short-term)

Which is better depends on your income bracket. See cost basis methods compared for detailed analysis.


Losses and Tax Benefits

Crypto losses are just as important as gains — they reduce your tax bill.

Capital loss rules:

  1. Losses first offset same-type gains (short-term offsets short-term)
  2. Remaining losses offset the other type
  3. Up to $3,000 of net losses can offset ordinary income
  4. Excess losses carry forward to future years (indefinitely)

Example:

TransactionGain/Loss
Sold BTC+$20,000 gain
Sold ETH−$8,000 loss
Sold DOGE−$5,000 loss
Net gain$7,000

Without the losses, you'd owe tax on $20,000. With netting, you only owe on $7,000.

If your net result is a loss (say, −$10,000):

  • Deduct $3,000 against ordinary income this year
  • Carry the remaining $7,000 loss forward to next year

Don't Forget These Taxable Events

EventHow to Calculate Gain
Spending cryptoFMV at spending − cost basis
Receiving as paymentTaxed as income at FMV; that becomes your cost basis
Mining rewardsIncome at FMV when received; becomes cost basis
Staking rewardsIncome at FMV when received; becomes cost basis
AirdropsIncome at FMV when received

Every taxable event needs tracking. Manual spreadsheets work for a few trades, but if you have dozens or hundreds, crypto tax software (Koinly, CoinTracker, TaxBit) automates the calculations.

See how gains fit into your overall taxes with the Federal Tax Calculator.

Share this article