NewGlanceDesk Crypto is now also in:EspañolPortuguês (Brasil)
GlanceDeskCrypto

Ask a crypto tool

Try:

Answers come from the same tested tools. Nothing you type leaves your device.

Crypto Cost Basis Calculator (FIFO and Average)

The numbers filled in are examples, not live prices. Type your own.

What you paid for that buy in total, fees included. Enter buys oldest first; leave unused rows empty.
Total received for the coins sold, after the sell fee

Bought a coin several times at different prices and sold some? See the cost of the coins sold, and the gain or loss, by first in, first out (FIFO) and by average cost (pooling), side by side, with what is left. A method calculator: it does not work out tax.

Gain or loss, FIFO · in your price currency
–
Gain or loss, average cost
–
Cost of the coins sold, FIFO
–
Cost of the coins sold, average cost
–
Average cost per coin (before the sale)
–
Coins left
–
Cost of the coins left, FIFO
–
Cost of the coins left, average cost
–

Assumptions

  • Buys are entered oldest first, and each total cost already includes its fees.
  • The amount received for the coins sold is after the sell fee.
  • A method calculator only: your tax authority's extra matching rules are not applied.

Checked HMRC Cryptoassets Manual CRYPTO22200: pooling (section 104 pool for each token type) All sources

Where the coins sold come from

BuyCoins boughtCost per coinTaken by FIFOTaken by average cost
Buy 1100105033.33333333
Buy 2502,500016.66666667
Total1508405050

How it is calculated

  • FIFO: the coins sold come from the oldest buy first; each buy's cost is used in proportion to the coins taken from it
  • Average cost (pool): cost of the coins sold = total cost of all buys × coins sold ÷ coins bought
  • Gain or loss = amount received − cost of the coins sold
  • Cost of the coins left = total cost − cost of the coins sold

Worked example

HMRC's own pooling example (CRYPTO22251): 100 tokens bought for 1,000 and 50 for 125,000, then 50 sold for 300,000.

You enter
Buy 1: coins100
Buy 1: total cost1,000
Buy 2: coins50
Buy 2: total cost125,000
Coins sold50
Received for them300,000
You get
Gain or loss, FIFO299,500
Gain or loss, average cost258,000
Cost of the coins sold, FIFO500
Cost of the coins sold, average cost42,000
Average cost per coin (before the sale)840
Coins left100
Cost of the coins left, FIFO125,500
Cost of the coins left, average cost84,000

By FIFO the coins sold cost 500, a gain of 299,500. By average cost they cost 42,000, a gain of 258,000.

Questions

Which method should I use?

The one your tax authority requires. This tool shows both so you can see the difference; it does not choose for you. If you are unsure, ask your tax authority or a qualified tax adviser.

Why do FIFO and average cost give different gains?

FIFO uses the price of your oldest coins first. If you bought cheaply long ago and dearly later, FIFO gives a lower cost and a higher gain now, and leaves the dearer coins for later. Average cost spreads every buy's price evenly.

Does this include the UK same-day and 30-day rules?

No. Those rules match buys on the same day, or within 30 days after a sale, before the pool is used. If you bought the same coin on the day of the sale or within 30 days after it, the UK result can differ from this tool.

Should fees be in the cost?

Enter each buy's total cost with its fee, and the amount received after the sell fee. Whether a fee counts as cost is a tax rule of your country.

Sources and checks

Last checked: 20 October 2026. This tool passes 7 automatic tests before every release. How we check our tools

Found a wrong number? Tell us

Your numbers never leave your device: the calculation runs in your browser and nothing you type is sent or stored.

A method calculator, not a tax calculator. Which method you must use, and any extra rules, are set by your tax authority: for example the UK matches same-day and 30-day buys before the pool (HMRC CRYPTO22200), and the US lets you identify specific units if your records allow it. Tax rates, allowances and losses are not included. This is not tax, legal or investment advice. Results are estimates for information only and are not financial, investment, tax or legal advice. Crypto prices move fast and leveraged trading can lose more than you expect. Check figures on your exchange or wallet before you act.

Related tools

Missing something? Suggest a tool