May 2026 · 6 min read
How to Calculate Your Crypto Cost Basis and Profit/Loss
Your cost basis determines your real profit, your break-even price, and your tax bill. Here is how average cost works, how it differs from FIFO, and how to track it without a spreadsheet.
Most people can tell you what their crypto is worth today. Far fewer can tell you what they actually paid for it. That second number — your cost basis — is the one that matters. It determines your real profit or loss, your break-even price, and in most countries your tax bill when you sell.
This guide explains how cost basis works, the difference between accounting methods, and how to keep it accurate as you trade.
What Is Cost Basis?
Cost basis is the total amount you paid to acquire an asset, including the price and any fees. If you buy 1 ETH for $3,000 plus a $10 fee, your cost basis for that ETH is $3,010.
Your profit or loss on a sale is simply:
Proceeds minus Cost Basis equals Realized Gain or Loss
Sell that ETH for $4,000 and your realized gain is $4,000 − $3,010 = $990.
The complication arrives when you buy the same asset multiple times at different prices — which is exactly what happens with dollar-cost averaging or any active accumulation.
Average Cost Basis
The simplest and most intuitive method is average cost. You add up everything you spent on an asset and divide by the total quantity you hold.
Suppose you make three Bitcoin purchases:
| Buy | Quantity | Price | Cost |
|---|---|---|---|
| 1 | 0.10 BTC | $60,000 | $6,000 |
| 2 | 0.05 BTC | $90,000 | $4,500 |
| 3 | 0.10 BTC | $70,000 | $7,000 |
Total: 0.25 BTC for $17,500. Your average cost basis is $17,500 ÷ 0.25 = $70,000 per BTC. That is your break-even price — above it you are in profit, below it you are at a loss.
Average cost is the method most portfolio trackers use because it gives a single, clear break-even number for each asset. WalletLens calculates this automatically: as you log each buy, it maintains your blended average cost, total invested, and live unrealized P&L.
FIFO and Other Tax Methods
For tax purposes, many jurisdictions require or allow specific lot-matching methods that differ from simple average cost:
FIFO (First In, First Out). When you sell, you are deemed to sell your oldest coins first. In a rising market this tends to produce larger taxable gains because your oldest coins usually have the lowest cost.
LIFO (Last In, First Out). You sell your newest coins first. This can reduce gains in a rising market but is not permitted everywhere.
HIFO (Highest In, First Out). You sell your most expensive coins first, minimizing taxable gains. Popular for tax optimization where allowed.
These methods only matter when you sell part of a position. If you sell everything, they all produce the same result. Always check the rules in your country, and consult a tax professional — this article is educational, not tax advice.
Realized vs Unrealized P&L
A crucial distinction:
Unrealized P&L is your paper gain or loss on assets you still hold. It moves with the market every second and has no tax consequence.
Realized P&L is locked in when you actually sell. This is what most tax systems care about.
A portfolio can show a large unrealized gain while you owe nothing in tax, because you have not sold. Understanding which is which prevents both overconfidence and surprise tax bills.
Why Stablecoins Should Be Excluded
A subtle but important point: stablecoins like USDT and USDC are pegged to roughly $1. They do not generate investment returns, so including them in your profit-and-loss calculation distorts the picture. If you hold $5,000 in USDC, that is not a position with a gain or loss — it is essentially cash waiting to be deployed.
Good trackers separate stablecoins from your invested assets. WalletLens treats stablecoins as cash for P&L purposes, so your reported profit reflects only the assets actually exposed to the market.
Fees, Airdrops, and Transfers
Real-world tracking has edge cases:
Trading fees add to your cost basis on a buy and reduce your proceeds on a sell. Over hundreds of trades, ignoring fees materially overstates your gains.
Transfers between your own wallets are not taxable events and do not change your cost basis — only the location of the coins.
Airdrops and rewards are typically treated as income at their value when received, which then becomes their cost basis for a future sale.
Keeping It Accurate
The only way to know your cost basis is to record every transaction as it happens. Reconstructing two years of trades from exchange statements after the fact is painful and error-prone.
A simple discipline: every time you buy or sell, log the asset, quantity, price, and date immediately. In WalletLens this takes a few seconds per trade and the app handles all the math — average cost, break-even, realized and unrealized P&L, and a per-asset breakdown. Export your full history any time for tax season.
Conclusion
Cost basis is the foundation of understanding your portfolio. Without it, "how much am I up?" is unanswerable. Track every trade, understand the difference between average cost and tax lot methods, separate stablecoins from invested assets, and you will always know your true break-even and real profit — not just today's market value.
Track your cost basis and realized P&L free at walletlens.live — no account needed.