How to Calculate Crypto Profit and Loss
A crypto profit calculator method you can do by hand: realized and unrealized gains, fees, FIFO or average cost for multiple buys, and common mistakes.
To calculate crypto profit or loss, subtract your total cost basis (the purchase price plus buying fees) from what you received or could receive when selling (the sale value minus selling fees). If you bought 0.5 BTC for 20,000 dollars including fees and sold it for 24,000 dollars after fees, your realized profit is 4,000 dollars, or 20%.
That simple formula gets more complicated once you buy at different prices, swap between coins, pay network fees or receive staking rewards. Getting it right matters for two reasons: you need honest numbers to judge your own decisions, and in many countries you need accurate records for taxes. This guide walks through the calculations step by step with simple, hypothetical examples.
The Basic Formula
Profit or loss = Proceeds − Cost basis
- Proceeds: the amount you received from selling, minus trading and withdrawal fees tied to the sale.
- Cost basis: what you paid to acquire the coins, including trading fees.
Return (%) = (Profit ÷ Cost basis) × 100
Example: one buy, one sell
| Step | Amount |
|---|---|
| Buy 2 ETH at 1,500 each | 3,000 |
| Buying fee | 15 |
| Cost basis | 3,015 |
| Sell 2 ETH at 1,800 each | 3,600 |
| Selling fee | 18 |
| Proceeds | 3,582 |
| Realized profit | 567 (about 18.8%) |
Notice that ignoring fees would have shown a profit of 600, overstating the result by 33. Fees add up quickly if you trade often.
Realized vs Unrealized Profit
- Realized profit or loss happens when you dispose of the coins: selling for cash, swapping for another token, or spending crypto on goods.
- Unrealized profit or loss is the difference between your cost basis and the current market value of coins you still hold.
Using the example above, if you had kept the 2 ETH while the price was 1,800, your unrealized profit would be 3,600 − 3,015 = 585 (before any future selling fee). It moves every time the price moves. Portfolio trackers usually show both numbers separately; our portfolio tool and the crypto converter help with quick checks. Our article How to Use a Crypto Converter for Quick Price Checks expands on this point.
Handling Multiple Purchases
Most people buy in several steps, for example through dollar-cost averaging. When you later sell part of your holdings, you need to decide which coins you sold. Suppose you made these hypothetical purchases:
| Purchase | Amount | Price per coin | Cost (incl. fees) |
|---|---|---|---|
| January | 1 coin | 100 | 101 |
| March | 1 coin | 200 | 202 |
| June | 1 coin | 300 | 303 |
You now sell 1 coin at 250, receiving 248 after fees.
FIFO (first in, first out)
You sold the January coin first. Profit = 248 − 101 = 147.
LIFO (last in, first out)
You sold the June coin. Loss = 248 − 303 = −55.
Average cost
Total cost 606 ÷ 3 coins = 202 per coin. Profit = 248 − 202 = 46.
The same sale shows a profit of 147, a profit of 46 or a loss of 55 depending on the method. Some tax authorities require a specific method, others allow a choice, and some use their own rules, such as pooling. Pick what is permitted where you live and apply it consistently. Our overview of how crypto taxes generally work explains the concepts.
Tricky Situations
Crypto-to-crypto swaps
Swapping BTC for ETH is usually treated as selling BTC at its market value and buying ETH at the same value. You realize a gain or loss on the BTC, and the ETH gets a new cost basis equal to its value at the time of the swap.
Network and gas fees
Fees paid to send or trade crypto can often be added to cost basis or subtracted from proceeds, depending on the transaction and local rules. Keep a record of them either way.
Transfers between your own wallets
Moving coins from an exchange to your own wallet is not a sale. Your cost basis travels with the coins. Many tracking errors happen when software treats an internal transfer as a disposal and a new purchase.
Staking rewards, airdrops and income
Rewards are often treated as income when received, at their market value at that time, which then becomes their cost basis. Rules vary widely, so check local guidance.
Losses and worthless tokens
Tokens that collapse to near zero still have a cost basis. Whether and how you can claim the loss depends on local rules, often requiring the tokens to be sold or formally disposed of.
Step-by-Step Checklist
- 1Export complete transaction histories from every exchange and wallet you have used.
- 2List every buy, sell, swap, transfer, fee and reward with dates, amounts and values in your home currency.
- 3Match transfers between your own accounts so they aren't counted as sales.
- 4Choose a cost-basis method that is allowed for you and apply it consistently.
- 5Calculate realized gains and losses for each disposal.
- 6Calculate unrealized gains on current holdings separately.
- 7Save your records; see how to keep records of crypto transactions for taxes.
Common Mistakes
- Forgetting fees, which inflates profits.
- Using today's price instead of the price on the transaction date.
- Treating wallet-to-wallet transfers as sales.
- Ignoring swaps because no cash was involved.
- Mixing methods from year to year without a reason.
- Relying on an exchange's profit display, which only sees activity on that exchange.
Bottom line
Crypto profit is proceeds minus cost basis, with fees included on both sides. The arithmetic is easy; the hard part is complete records and a consistent method for matching sales to purchases. Keep clean transaction histories, separate realized from unrealized results, and check how your country treats swaps, rewards and cost-basis methods before you file anything.
Frequently asked questions
What is the formula for crypto profit?
Profit equals what you received when selling, minus selling fees, minus your cost basis. Cost basis is what you paid to acquire the coins, including purchase fees. As a percentage, divide the profit by the cost basis and multiply by 100. Unrealized profit uses the current market value instead of sale proceeds.
What is the difference between realized and unrealized profit?
Realized profit or loss is locked in when you sell, swap or spend crypto. Unrealized profit or loss is the paper gain or loss on coins you still hold, based on today's price. Unrealized figures change constantly, while realized figures are fixed once the transaction happens.
Should I use FIFO or average cost?
It depends on what your tax authority allows or requires and on your own tracking preferences. FIFO assumes the earliest coins are sold first; average cost spreads the purchase price evenly. Some countries mandate a specific method. Check your local rules or ask a qualified tax professional.
Do swaps between cryptocurrencies count as profit or loss?
In many countries, swapping one cryptocurrency for another is treated as disposing of the first one, which can realize a gain or loss even though you never received cash. You then have a new cost basis in the coin you received. Rules differ by country.
