How to calculate your crypto cost basis across multiple exchanges
You bought bitcoin on Kraken, then on Coinbase, and each app shows its own “average cost”. Neither is yours: the only cost basis that counts is calculated across all your accounts at once.

Calculating your crypto cost basis is easy as long as you buy on a single exchange. Once your bitcoin is spread across Kraken, Coinbase and a Ledger, each app only sees its own share. Its “average cost” is only true for that app.
I’ve bought bitcoin more than 230 times, across five accounts. Here is the method I used by hand, and the traps that skew it.
The crypto cost basis formula, with a worked example
Your cost basis per coin, also called average cost, is what each unit you still hold cost you on average. Compared with today’s price, it tells you whether a position is up or down.
Average cost = (amounts paid + fees) ÷ quantities bought
Three bitcoin buys on two exchanges (made-up example, rounded prices):
| Date | Exchange | Quantity received | Amount paid | Fees | Total cost |
|---|---|---|---|---|---|
| 2025-01-12 | Kraken | 0.020 BTC | $1,800.00 | $1.80 | $1,801.80 |
| 2025-03-03 | Coinbase | 0.010 BTC | $750.00 | $15.00 | $765.00 |
| 2025-06-06 | Kraken | 0.015 BTC | $1,350.00 | $1.35 | $1,351.35 |
| Total | 0.045 BTC | $3,918.15 |
Average cost = $3,918.15 ÷ 0.045 BTC = $87,070 per bitcoin.
It’s a weighted average: a big buy counts more than a small one. The simple average of the three prices would be $85,560, or $1,510 less, because it gives the small March buy as much weight as the other two.

In Excel or Google Sheets, with quantities in column C and total costs in column F: =SUM(F2:F4)/SUM(C2:C4).
Fees belong in your cost basis
Leaving them out understates your cost basis and inflates your gain. They come in three forms:
- in dollars: add them to the amount paid;
- taken from the coin you receive, as Binance often does: log the quantity that actually arrived;
- paid in another coin, such as BNB: convert them to dollars at that day’s price.
One cost basis per exchange, or one overall?
This is the question people ask most on forums. The answer is simple: one cost basis per coin, across all your accounts. A bitcoin is the same bitcoin from one exchange to the next.
Here is my own history, in the dollars of each purchase date:
| Calculation | Bitcoin cost basis |
|---|---|
| Buys on Crypto.com App only | $41,100 |
| Buys on OKX only | $65,300 |
| Buys on Kraken only | $69,700 |
| Buys on Binance only | $91,500 |
| All accounts together | $81,800 |
My first buys went through Crypto.com App, while bitcoin was cheap. Binance took over after that. Looking at Binance alone would put my cost basis 12% too high. Looking at Crypto.com App alone, at half the real figure.
A transfer between your accounts is not a purchase
This is the main trap. Sending bitcoin from Coinbase to Kraken changes neither your quantity nor your cost: you didn’t buy anything.
The receiving exchange doesn’t know that. Binance.US says it plainly: for a deposit, “the price of purchase is the market price at the moment you deposit the asset”. Your 0.010 BTC bought for $765 becomes a $920 purchase if bitcoin trades at $92,000 that day.

In the example, the average cost jumps from $87,070 to $90,514. The more your coins travel, the bigger the error.
What happens to your cost basis when you sell
Selling doesn’t change your average cost. The units you sell leave at the average price, and the ones you keep keep their cost.
You sell 0.015 BTC for $1,500, with a $1.50 fee:
- cost of the units sold: $87,070 × 0.015 = $1,306.05;
- realized gain: $1,500 − $1.50 − $1,306.05 = $192.45;
- you’re left with 0.030 BTC, still at $87,070 per bitcoin.
The average only moves with your next buy. If you sell everything, the next one starts from zero.
The realized gain on this sale and the unrealized gain on what’s left add up to your total gain: see realized vs unrealized crypto gains.
Crypto-to-crypto trades and rewards
Swapping 0.5 ETH for 0.02 BTC means selling ETH and buying BTC in the same move. If ETH trades at $3,200 that day, you buy 0.02 BTC for $1,600. Your ETH average cost doesn’t move; your BTC one takes in the new buy.
A staking reward, on the other hand, was never bought. Count it at $0 (your average cost drops) or at its value on the day you received it. Pick one rule and stick to it.
The free crypto cost basis spreadsheet
Google Sheets makes a copy in your Drive. The .xlsx file also opens in LibreOffice.
One sheet per coin, one row per transaction. You pick the type (buy, sell, fee, reward or transfer) and fill in the yellow cells. The file works out the quantity held, the average cost and the gain on each sale, and flags input mistakes. It comes pre-filled with this article’s example, and a “How to use” sheet explains every formula.
To track every coin in one file, not just its cost basis, see the free crypto portfolio tracker spreadsheet.

When a spreadsheet stops being enough
For one exchange and a few buys a year, a spreadsheet is enough. It breaks as your history grows:
- transfers: an export shows a withdrawal on one side and a deposit on the other, and matching them is up to you;
- historical prices: every fee paid in BNB and every crypto-to-crypto trade needs one;
- volume: my 230 bitcoin buys are 230 rows to type without a single mistake.
And an error doesn’t show. A transfer counted as a buy gives a plausible cost basis, and a wrong one.
Crypto Master runs this calculation from your accounts, with nothing to re-type. Your exchanges connect through a read-only API key or a file import, your wallets through their public address. Transfers between your accounts aren’t counted as purchases, and a deposit of unknown origin doesn’t get an invented price: the screen asks you what it was.

On a coin’s page, you see its balance account by account, under a single cost basis.

API keys can neither trade nor withdraw (Security page). The free plan covers 3 connected accounts and 500 transactions (pricing).
Average cost is a tracking measure, not a tax method
Tax rules differ by country. In the US, the IRS doesn’t accept average cost for crypto, and since January 1, 2025, cost basis is tracked wallet by wallet (Rev. Proc. 2024-28). Use your average cost to follow your positions, not to file your return. For the return, Crypto Master prepares Form 8949 separately, lot by lot and account by account.
Frequently asked questions
How do I calculate my crypto cost basis?
Add up everything you paid for the coin, fees included, and divide by the quantity you bought, across all your exchanges.
Should fees be included in the cost basis?
Yes, they’re part of the price you paid. A fee paid in another coin is converted at that day’s price.
Is Binance’s average cost accurate?
Only for Binance. A coin that arrives from another account is counted at the market price on the day of the deposit, not at what you paid for it.
Should I track cost basis per exchange or overall?
Overall, to know how a position is really doing. A per-exchange figure goes wrong as soon as you move coins between accounts.
Does my average cost change when I sell?
No. It only moves with your next buy.
Can I use average cost for my taxes?
Often not: the US IRS, for instance, doesn’t accept average cost for crypto. Crypto Master prepares Form 8949 separately, with FIFO, HIFO or LIFO lots.
See cost basis calculated across accounts on a sample portfolio, no sign-up needed.
Open the demo



