Crypto average cost calculator
Type each buy of one asset on its own line: the quantity, the amount paid, and the fee. Pick whether fees are added to cost or left out. The page adds the quantities and the costs and divides, giving the average cost per unit to eight decimal places, with each buy's own cost per unit beside it. Type a price per unit to compare with and it also shows what the total quantity is worth at that price and how far that is from the total cost.
What you type stays in your browser on this device. Nothing is uploaded.
One line per buy. Quantity takes up to 8 decimal places. Amount paid is the total for the buy in dollars, before the fee. A line left blank is skipped.
| Line | Quantity | Amount paid | Fee |
|---|
Average cost
Each buy, with its cost per unit
The page divides total cost by total quantity. It does not match sales to lots: for that, the capital gains worksheet works through an export of buys and sales lot by lot. It is not a tax form and it does not say what to report.
What gets checked
- Every buy is in the result once, with its quantity, and its cost is the amount paid plus the fee, or the amount paid alone when fees are left out.
- Total quantity, total paid before fees, and total fees each equal the lines added a second way, in whole units of 0.00000001 and whole cents.
- Total cost equals total paid before fees plus total fees, or total paid alone when fees are left out.
- The average cost per unit, multiplied by the total quantity, gives the total cost back to within half of the eighth decimal place. The same is tested for the cost per unit of every buy.
- The average cost per unit lies between the lowest and the highest cost per unit among the buys.
- With a price typed in: the value is the total quantity times that price, to the cent, and the difference is that value minus the total cost.
How it works
- Type the buys. One line per buy of the same asset: quantity, amount paid in dollars before the fee, and the fee. Add a line for each buy; a line left blank is skipped. Quantities take up to 8 decimal places.
- Pick how fees are handled. Fees are either added to cost or left out. The choice is not made for you, and the result says which was used.
- Read the average. Total cost divided by total quantity is the average cost per unit, rounded at the eighth decimal place. Each buy's own cost per unit is listed beside it, and the certificate shows every check.
- Compare with a price, and export. A price per unit can be typed to see the value of the total quantity at that price and the difference from the total cost. Download Excel or CSV, or print.
Worked example
Three made-up buys of one coin, with fees added to cost and a price of $40,000.00 per unit to compare with.
| Line | Quantity | Amount paid | Fee | Cost | Cost per unit |
|---|---|---|---|---|---|
| 1 | 0.5 | $15,000.00 | $15.00 | $15,015.00 | $30,030.00 |
| 2 | 0.25 | $10,000.00 | $10.00 | $10,010.00 | $40,040.00 |
| 3 | 0.1 | $4,500.00 | $4.50 | $4,504.50 | $45,045.00 |
Total quantity 0.85, total paid before fees $29,500.00, total fees $29.50, total cost $29,529.50. Average cost per unit: $29,529.50 divided by 0.85 is $34,740.58823529. At $40,000.00 per unit, 0.85 is worth $34,000.00, which is $4,470.50 more than the total cost. With fees left out, the total cost is $29,500.00 and the average is $34,705.88235294.
The example uses made-up names and numbers.
Questions
Is the average cost the same as cost basis?
It is total cost divided by total quantity for the buys typed in, and nothing more. The page does not match sales to lots and does not say what figure belongs on any form. The capital gains worksheet on this site works through buys and sales lot by lot under the method you pick there.
Are fees included?
That is your choice. With fees added to cost, each buy's cost is the amount paid plus its fee. With fees left out, cost is the amount paid alone and the total of the fees is still shown.
Why eight decimal places?
A coin can be worth a fraction of a cent, so an average rounded to the cent could read as zero. Quantities are kept in whole units of 0.00000001 and a cost per unit in whole units of $0.00000001, with money in whole cents, so nothing drifts.
How is the average checked?
By multiplying it back. The average times the total quantity has to give the total cost to within half of the last decimal place, and the average has to lie between the cheapest and the dearest buy. The totals are also added a second way.
Can I mix different coins?
No. Every line is taken as a buy of the same asset. Use the page once for each asset.
Does it handle sales?
No. It works on buys only. A sale changes which lots are left, and that is lot matching, which the capital gains worksheet does.
This tool calculates and checks numbers. It is not legal, tax, or medical advice.