How to calculate crypto profit and loss
Average buy price, unrealized and realized profit, and the 24-hour change, worked through with one bitcoin example from start to finish.
Crypto profit and loss is the current value of your coins minus what you paid for them, fees included. With several purchases, first find your average buy price (total spent divided by total coins bought), then profit = amount held times (current price minus average buy price). Profit on coins you still hold is unrealized; profit on coins you sold is realized.
What are the formulas?
- Cost = amount bought times buy price, plus fees.
- Average buy price = total cost of all purchases divided by total amount bought.
- Current value = amount held times current price.
- Unrealized P&L = current value minus the cost of the coins you still hold.
- P&L percent = P&L divided by cost, times 100.
- Realized P&L on a sale = sale proceeds minus fees minus the cost of the coins sold.
A worked example with bitcoin
The prices below are illustrative round numbers, not market data. Fees are left out to keep the arithmetic clear; in real life add them to the cost of each purchase.
Step 1: two purchases
| Purchase | Amount | Price per BTC | Cost |
|---|---|---|---|
| First | 0.5 BTC | 40000 USD | 20000 USD |
| Second | 0.3 BTC | 60000 USD | 18000 USD |
| Total | 0.8 BTC | 38000 USD |
Step 2: average buy price
38000 USD divided by 0.8 BTC = 47500 USD per BTC.
Note that this is not the simple average of 40000 and 60000 (which would be 50000). You bought more at the lower price, so the average is weighted toward it.
Step 3: unrealized profit at today's price
Say BTC is now 70000 USD.
- Value: 0.8 times 70000 = 56000 USD.
- Profit: 56000 minus 38000 = 18000 USD.
- Percent: 18000 divided by 38000 = 0.4737, so 47.37%.
The same result from the average price: 0.8 times (70000 minus 47500) = 0.8 times 22500 = 18000 USD.
Step 4: selling part of it
You sell 0.2 BTC at 70000 USD and receive 14000 USD.
With the average cost method, the coins you sold cost 0.2 times 47500 = 9500 USD, so the realized profit is 4500 USD. You keep 0.6 BTC with a remaining cost of 38000 minus 9500 = 28500 USD, and 28500 divided by 0.6 is still 47500: the average buy price does not change when you sell.
Unrealized profit on what is left: 0.6 times 70000 = 42000, minus 28500 = 13500 USD.
Check: 4500 realized plus 13500 unrealized = 18000, the same total as before the sale. Selling moved profit from one column to the other; it did not create any.
Step 5: the same sale under FIFO
FIFO (first in, first out) assumes you sold the oldest coins first. The 0.2 BTC come from the first purchase at 40000, so their cost is 8000 USD and the realized profit is 6000 USD. The remaining 0.6 BTC (0.3 at 40000 and 0.3 at 60000) cost 30000 USD, so unrealized profit is 42000 minus 30000 = 12000 USD. The total is again 18000; only the split differs.
Which method applies to your taxes depends on your country. A tracker's figure is a guide to performance, not a tax calculation.
What does "24h P&L" mean?
It is how much your current holdings gained or lost over the last 24 hours, regardless of when you bought them. If BTC was 68000 USD a day ago and is 70000 now, your 0.6 BTC changed by 0.6 times 2000 = 1200 USD, or 2000 divided by 68000 = 2.94%. The same logic gives 7-day, 180-day or any other period.
What mistakes make P&L wrong?
- Forgetting fees. Trading and network fees raise your real cost.
- Treating transfers as purchases. Moving coins from an exchange to your own wallet is not a buy and does not change the cost.
- Mixing currencies. Keep cost and value in the same fiat currency, or convert at the rate of the purchase date.
- Counting coins bought with other crypto at the wrong cost. If you bought ETH with BTC, its cost is the value of the BTC you gave up at that moment.
Where does cryptoc fit?
cryptoc calculates this for you once you enter each coin's amount and, optionally, its average buy price. It shows total value, profit and loss over 24 hours, 180 days and all time (all-time uses your average buy price), and an allocation chart, in any of 50+ fiat currencies. It stores one average buy price per coin rather than individual lots, so it does not compute FIFO or realized gains and does not produce tax reports. For that, use a tax tool or a spreadsheet with one row per trade. See how to track a crypto portfolio manually for a simple setup.
Questions
How do I calculate profit on crypto?
Multiply the amount you hold by the current price to get the value, then subtract what you paid for those coins including fees. Divide the result by what you paid and multiply by 100 for the percentage.
How do I calculate my average buy price for crypto?
Add up everything you spent on a coin, including fees, and divide by the total number of coins you bought. For 0.5 BTC bought for 20000 USD and 0.3 BTC for 18000 USD, it is 38000 divided by 0.8, which is 47500 USD.
What is the difference between realized and unrealized profit?
Unrealized profit is on coins you still hold and changes with the price. Realized profit is locked in when you sell, and it is the figure that usually matters for tax.
Does selling some coins change my average buy price?
Under the average cost method, no. Selling reduces the amount and the remaining cost in the same proportion, so the average buy price of the coins you keep stays the same.
Which method should I use for taxes, FIFO or average cost?
That depends on your country's rules, which differ. Check your local tax authority's guidance or a tax advisor; a portfolio tracker's profit figure is not a tax calculation.