CryptoCalcPro
All posts
Crypto8 minThe CryptoCalcPro Team

How to Calculate Crypto Profit and Loss (With Examples)

A practical guide to computing crypto P&L — with fees, multi-buy averaging, and tax-relevant cost basis. Includes worked examples and the math behind every formula.

Your wallet shows a number. Is it right? Probably not. The portfolio screen on your exchange ignores fees, averages out the buys you made at different prices, and forgets about the swap you did six months ago that the tax office still treats as a sale. This guide walks through what your real crypto P&L looks like, with math you can verify by hand and a free crypto profit calculator that does it for you.

The simple case: one buy, one sell

When you buy once and sell once, the formula is identical to any other asset:

Profit = (Sell Price × Amount) − (Buy Price × Amount) − Fees

Say you bought 0.5 BTC at $42,000 and later sold it all at $58,000. Fees on both legs totalled $80.

Buy cost  = 0.5 × $42,000 = $21,000
Sale      = 0.5 × $58,000 = $29,000
Profit    = $29,000 − $21,000 − $80 = $7,920

To get the return as a percentage:

Return % = Profit ÷ Buy cost × 100
        = $7,920 ÷ $21,000 × 100
        ≈ 37.7%

That's the number you'd quote when comparing this trade to other investments. The formula is unambiguous. The trouble starts the moment you do anything other than one clean buy followed by one clean sell.

When you bought at multiple prices

Almost nobody buys their whole position in one go. People dollar-cost average. They add on dips. They trim and reload. Once that happens, "buy price" stops being a single number and turns into a weighted average — your cost basis. It's the most important number for both performance tracking and taxes.

Here's a real-looking example. Over six months you make four purchases of bitcoin:

| Purchase | Amount | Price | Cost | | -------- | ------- | --------- | -------- | | 1 | 0.10 BTC | $40,000 | $4,000 | | 2 | 0.20 BTC | $45,000 | $9,000 | | 3 | 0.15 BTC | $52,000 | $7,800 | | 4 | 0.05 BTC | $61,000 | $3,050 | | Total | 0.50 BTC | — | $23,850 |

Cost basis is total cost divided by total amount:

Cost basis = $23,850 ÷ 0.50 = $47,700 per BTC

That's the "buy price" to plug into the formula. If BTC is now trading at $58,000 and you sell the full 0.5 BTC:

Profit = 0.5 × ($58,000 − $47,700) = $5,150

A lot less than $8,000, which is what you'd get if you used the lowest purchase price as your basis. Most beginners think in terms of "what's my best buy" and badly overestimate their gains.

Partial sells: which BTC did you sell?

It gets more interesting when you only sell part of your stack. Sell 0.3 of your 0.5 BTC and the obvious question is: which 0.3 BTC? The answer depends on your accounting method, and this is where retail traders and tax authorities often disagree.

The three common methods:

  • FIFO (First-In, First-Out) — the oldest coins go first. Tax authorities in the US, UK, India, and most of the EU default to this.
  • LIFO (Last-In, First-Out) — the newest coins go first. Allowed in some jurisdictions and can save tax in a falling market.
  • Average cost — every coin counts as the weighted average. Simplest to track, not always allowed for taxes.

Using the table above, sell 0.3 BTC at $58,000 under FIFO and you've sold the first 0.10 BTC at $40,000, then 0.20 BTC at $45,000:

Cost basis = 0.10 × $40,000 + 0.20 × $45,000 = $13,000
Profit    = 0.3 × $58,000 − $13,000 = $4,400

Under LIFO you flip the order. The latest 0.05 BTC at $61,000 first, then 0.15 at $52,000, then 0.10 at $45,000:

Cost basis = 0.05 × $61,000 + 0.15 × $52,000 + 0.10 × $45,000
           = $3,050 + $7,800 + $4,500 = $15,350
Profit    = 0.3 × $58,000 − $15,350 = $2,050

Same trade, same prices, same coins sold. Reported profit differs by more than 2x. This is why your method choice matters, and why keeping records as you go is so much easier than rebuilding them later.

Fees: where most calculators get it wrong

Casual P&L math either ignores fees or counts them once. Both are wrong. A complete fee accounting touches three spots:

  1. Buy fee. Add it to your cost basis. Paid $5,000 for ETH and $25 in fees? Your basis is $5,025, not $5,000.
  2. Sell fee. Subtract from proceeds. Sold for $7,000 and paid $30 in fees? You received $6,970.
  3. Swap fees. Trading ETH for SOL on a DEX counts as a taxable disposal in most jurisdictions. The gas fee acts as a sell fee on the ETH leg and a buy fee on the SOL leg.

The cleaned-up formula:

Profit = (Sell Price × Amount − Sell Fees)
       − (Buy Price × Amount + Buy Fees)

The crypto profit calculator takes a single fee field subtracted from total proceeds, which is the right model for a clean round trip. For multiple lots, swaps, and staking rewards, a portfolio tracker like CoinTracker or Koinly does the lot accounting for you.

Realised vs unrealised: the difference that catches everyone

Open any portfolio app and you'll see two numbers. Unrealised P&L is what you'd make if you sold right now. Realised P&L is what you've actually locked in. They aren't the same, and treating them the same is the most common trading-psychology mistake.

Unrealised gains only become real at the moment of sale. Until then they're paper numbers that can — and historically do — vanish. A workable rule:

  • Track unrealised P&L to see how your strategy is performing.
  • Plan against realised P&L for taxes and major purchases.
  • Don't spend against unrealised gains without first realising some of the position.

Bitcoin's three biggest bull runs each ended the same way. Holders watched 5–10x paper gains turn into 70–80% paper losses inside six months. Compounding cuts both ways. The sequence of returns matters as much as the average.

What about tax?

Every realised trade in crypto is a taxable event in most countries. That includes:

  • Selling crypto for fiat
  • Trading one crypto for another (yes, even stablecoin swaps)
  • Spending crypto on goods or services
  • Receiving crypto as income, mining reward, or airdrop

Holding longer than a year usually qualifies for a lower capital-gains rate, but the threshold varies by country. So do the actual rates. The US charges roughly 15% long-term capital gains for most earners. India taxes every crypto transaction at 30% regardless of holding period. The UK sits at 18% or 24% depending on income band.

For a ballpark on what you'd owe, our income tax calculator handles the US, UK, India, and Pakistan. It models ordinary-income brackets. For capital-gains specifics in a high-volume trading year, you want a tax professional.

The practical workflow

If you take one thing from this guide, take this: the math is easy. The record-keeping is what kills people. A workable system looks like this:

  1. Export trade history from every exchange monthly. Most exchanges have a CSV button. Save them in one folder.
  2. Pick an accounting method and stick with it. FIFO is the safest default. Tax authorities expect it, and you can switch later if a different method materially saves you money.
  3. Track cost basis, not just price. Cost basis = price × amount + fees. A spreadsheet with one row per buy works fine up to ~50 trades.
  4. Reconcile against your wallet quarterly. If the math says you should have 0.834 BTC and the wallet shows 0.831, find the missing 0.003 now, not six months from now.
  5. Don't make decisions on unrealised gains. Paper profits feel like real money. They aren't.

For a sanity check on any single trade, the crypto profit calculator handles both manual mode (you supply the buy and sell prices) and historical mode (pick a date, the calculator pulls the actual market price for that day). Same formula you'd use by hand, no arithmetic errors.

The whole skill of trading is making the decisions. The math should be the easy part.