Crypto average cost calculator: your cost basis per coin

Work out the average cost of your crypto for free, with several buys, sales and fees: your average cost per coin, realized gains and unrealized gains.

    Result

    Average cost
    -
    Quantity held
    -
    Amount invested
    -
    Realized gain
    -
    Current value
    -
    Unrealized gain
    -

    The calculation runs in your browser: nothing is sent.

    Your average cost is what each unit you hold cost you on average, fees included. Add your buys and sales above: the calculator gives your average cost, your realized gain and, with the current price, your unrealized gain. The calculation runs in your browser, nothing is sent.

    The average cost formula

    Your average cost is the total amount of your buys, fees included, divided by the quantity bought:

    Average cost = (sum of amounts bought + buying fees) ÷ quantity bought

    It is also called the average purchase price or weighted average cost: each buy counts in proportion to its quantity.

    An example

    OperationQuantityPriceFeesCost
    Buy0.5 BTC$40,000$20$20,020
    Buy0.25 BTC$60,000$15$15,015
    Total0.75 BTC$35,035

    Your average cost is $35,035 ÷ 0.75 = $46,713.33 per bitcoin. As long as bitcoin trades above that price, your position shows a gain.

    What happens when you sell?

    With the weighted average method, a sale does not change the average cost of the units you keep: it lowers the quantity and the amount invested in the same proportion. Your realized gain is what the sale brings in, fees deducted, minus the average cost of the units sold.

    If you sell 0.25 BTC at $70,000 with $10 in fees, you receive $17,490. Those 0.25 BTC cost you 0.25 × 46,713.33 = $11,678.33. Your realized gain is $5,811.67, and the 0.5 BTC you keep still have an average cost of $46,713.33.

    Average cost and taxes

    Tax rules on crypto gains differ from country to country. In the United States, for example, each sale's gain is worked out from the cost basis of the specific units sold, by a method such as first in, first out (FIFO) unless you identify the units: your average cost tracks your positions, it does not replace that calculation.

    Your average cost across every platform

    A platform only knows the operations made on it, and does not always show your average price. CentraFIN reads your whole execution history on Kraken, Coinbase, OKX, Binance, Hyperliquid and Interactive Brokers, and works out your average cost for you, updated with every execution.

    Learn more: Average cost, FIFO and France's method.

    Frequently asked questions

    Are fees included in the average cost?

    Yes. Buying fees are added to the cost, and selling fees reduce what the sale brings in.

    Does a sale change my average cost?

    No. With the weighted average method, the units you keep keep the same average cost; only your realized gain changes.

    What is the difference between average cost and cost basis?

    Your cost basis is the total you paid for what you hold, fees included; your average cost is that total divided by the quantity held.

    Are my numbers sent anywhere?

    No. The calculation runs in your browser; nothing is sent or kept.

    Your average cost, worked out for you

    Connect Kraken, Coinbase, OKX, Binance, Hyperliquid or Interactive Brokers read-only: CentraFIN works out your average cost over your whole history.