How do I calculate my crypto cost basis?
This guide explains how to calculate your crypto cost basis using HMRC’s matching rules including the same day rule, the 30 day rule and the Section 104 pool.
Calculating your crypto cost basis is one of the most important parts of preparing your UK tax return because it determines whether you made a gain or a loss when you disposed of your crypto. In my opinion this is the area of crypto taxation that causes the most confusion because the UK uses a specific set of rules called the share matching rules rather than a simple FIFO method. These rules apply to crypto in the same way they apply to shares which means you cannot pick and choose which coins you sold. You must follow the HMRC method.
This guide explains how to calculate your crypto cost basis step by step. I cover the UK’s matching rules, the 30 day rule, the pooling method, how to handle multiple purchases, staking, mining, airdrops, transfers, fees and what happens when you move coins between wallets. By the end you will understand exactly how to calculate cost basis correctly for Capital Gains Tax.
First: what is cost basis?
Your cost basis is the amount you spent to acquire your crypto plus any fees or transaction charges. It is used to calculate your gain.
Gain = Proceeds minus cost basis minus allowable fees
Example:
You bought Bitcoin for £3,000 and sold it for £4,500.
Proceeds: £4,500
Cost basis: £3,000
Gain: £1,500
In my opinion the concept is simple but the UK method of calculating the cost basis for multiple transactions is where things get more complex.
The UK does not use FIFO for crypto
Many countries use the FIFO method which means “first in first out”. The UK does not. Crypto is treated like a share for tax purposes which means you must use:
Same day rule
30 day rule (bed and breakfasting rule)
Section 104 pool (the pooled average method)
These three rules must be applied in order every time you make a disposal.
In my opinion understanding the order of these rules solves 90 percent of crypto tax confusion.
The three UK crypto cost basis rules
Here is how HMRC requires you to match crypto disposals with previous acquisitions.
1. The same day rule
If you buy and sell the same crypto on the same day, you must match these transactions first.
Example
10 April
Buy 1 ETH at £1,400
Sell 1 ETH at £1,500
Your cost basis is the £1,400 you paid that day.
This rule is simple and always applied first.
2. The 30 day rule (bed and breakfast rule)
If you sell crypto then buy back the same crypto within 30 days, the buy within 30 days must be matched with the earlier sale.
This prevents people from selling and buying back immediately to create artificial tax losses.
Example
1 June
Sell 2 ETH
10 June
Buy 2 ETH
The cost basis of the 2 ETH sold on 1 June is the price you paid on 10 June.
The 30 day rule is applied before the pooling method.
In my opinion this rule catches many UK investors by surprise especially those who trade frequently.
3. The Section 104 pool (the pooled average rule)
Any crypto that is not matched under the same day or 30 day rule is added to a pooled cost basis. The Section 104 pool works like this:
All acquisitions of the same crypto are grouped together
You calculate an average cost per unit
When you sell crypto that is not matched under the previous rules you use the average cost as your cost basis
This pool is updated every time you buy more of the same crypto.
Example
You bought:
1 ETH for £1,200
1 ETH for £1,400
2 ETH for £1,600 each
Total spent: £5,800
Total ETH: 4
Average cost per ETH: £1,450
If you then sell 1 ETH and it is not matched using the first two rules, your cost basis is £1,450.
In my opinion understanding the Section 104 pool is essential because most UK investors calculate crypto cost basis incorrectly by not using the pool.
Step by step: how to calculate your crypto cost basis
Below is the full method you must follow.
Step 1: List all your crypto transactions
You need a full list of:
Buys
Sells
Swaps
Transfers
Fees
Rewards
Mining income
Airdrops
HMRC expects you to keep this data for at least six years.
Step 2: Convert every transaction into GBP
HMRC requires all crypto values in pounds, even if you traded crypto to crypto.
You must convert the transaction values using the GBP value on the date of the transaction.
In my opinion most people skip this step and end up with inaccurate gains.
Step 3: Apply the same day rule
Match any buys and sells that happened on the same day. These transactions do not go into the pool.
Step 4: Apply the 30 day rule
If you sell crypto, check whether you bought any of the same crypto within the next 30 days.
Match these transactions next.
Step 5: Add remaining coins to the Section 104 pool
Everything not matched under the previous rules goes into the pool.
The pool value is:
Total amount spent + total acquisition fees.
The average cost per token is:
Pool value ÷ total number of tokens.
Step 6: When selling crypto, use the average cost per token
Calculate:
Proceeds
Cost basis (units sold × average cost from the pool)
Allowable disposal fees
Your gain is:
Proceeds minus cost basis minus fees.
Worked examples to make the rules clear
Let’s look at realistic crypto scenarios.
Example 1: Using the Section 104 pool
You bought:
1 ETH for £1,000
1 ETH for £1,400
Your pool is:
Total cost: £2,400
Total ETH: 2
Average cost: £1,200 per ETH
Later you sell 1 ETH for £1,800.
Cost basis: £1,200
Gain: £600
Example 2: Same day rule overrides the pool
You have:
A pool of 3 ETH with an average cost of £1,300
On 1 July you:
Buy 1 ETH for £1,500
Sell 1 ETH for £1,700
The sale is matched to the same day purchase.
Cost basis: £1,500
The pool remains unchanged at 3 ETH for £3,900.
Example 3: 30 day rule overrides the pool
10 May
Sell 2 ETH
20 May
Buy 1 ETH for £1,600
25 May
Buy 1 ETH for £1,650
Both buys are matched to the earlier sale.
Cost basis for the sale = £1,600 + £1,650
These units do not enter the pool.
Example 4: Crypto to crypto swaps
Swapping ETH for BTC counts as a disposal for CGT.
You must:
Record the GBP value of ETH at the time of disposal
Record the GBP value of BTC acquired
Update your BTC Section 104 pool
Reduce your ETH pool
Even if you never withdrew to cash you still owe tax on the gain.
In my opinion this is one of the most frequently misunderstood crypto tax rules in the UK.
How fees affect your cost basis
You can add fees to the cost basis or deduct them from proceeds depending on how the fee was charged.
You can include:
Exchange fees
Gas fees
Withdrawal fees if they relate to an acquisition or disposal
You cannot include:
Wallet creation fees
General blockchain fees not tied to acquisition or disposal
Subscription fees
How to calculate cost basis when moving crypto between wallets
Moving crypto between your own wallets is not a taxable event.
However:
You must keep records of wallet addresses
You must track the cost basis of tokens moved
The Section 104 pool continues unchanged
Transferring crypto does not reset your cost basis.
How cost basis works for staking rewards, mining and airdrops
These forms of crypto income have special rules.
Staking rewards
Staking rewards are treated as income at the GBP value you received them
This income is added to your Section 104 pool as an acquisition
The value at receipt becomes your cost basis
Mining
Mining rewards are income
The GBP value at the point of receipt is added to your pool
Later disposals use the pooled average cost
Airdrops
If received without performing any work
Value at receipt is added to the pool
Taxed as capital only on disposal
If received for work or service
Taxed as income when received
Value added to Section 104 pool
In my opinion people often misunderstand this and declare airdrops incorrectly.
How cost basis works when you lose crypto
Losses must be reported to HMRC to count.
You can claim a negligible value claim if:
You lost access to a wallet
A token collapsed in value
An exchange collapsed
This sets the cost basis to zero and crystallises a loss you can use to offset gains.
Practical tools to help calculate cost basis
Most people find manual cost basis calculation overwhelming especially with hundreds of transactions.
You can use:
Koinly
Accointing
CoinTracker
CryptoTaxCalculator
Recap
These tools use HMRC’s Section 104 matching rules.
However in my opinion you should still understand the rules yourself so you can verify the calculations.
Common mistakes people make when calculating cost basis
Mistake 1: Using FIFO
The UK does not use FIFO.
Mistake 2: Not applying the 30 day rule
This can lead to incorrect gains.
Mistake 3: Not converting values to GBP
HMRC only accepts GBP figures.
Mistake 4: Ignoring fees
These reduce gains when applied correctly.
Mistake 5: Not tracking airdrop or staking values
Income values must be added to the pool.
Mistake 6: Combining wallets incorrectly
Transferring between your own wallets is not a disposal.
Mistake 7: Not matching transactions in the correct order
The rules must be followed in the order:
Same day → 30 day → Pool.
In my opinion these mistakes are the main reason HMRC enquiries happen.
Real world examples
Example A: Active trader with many swaps
Daniel swapped dozens of tokens each month. Once he understood that each swap was a disposal and adjusted his Section 104 pool correctly his tax calculations finally matched HMRC expectations.
Example B: Staking rewards misclassified
Amelia did not include staking rewards in her pool. This caused her cost basis to be too low on disposal. After adding rewards as income and including them in the pool the numbers became accurate.
Example C: Lost access to a wallet
Kiran lost access to a wallet containing £12,000 of tokens. He submitted a negligible value claim and used the loss to offset gains from a different crypto sale.
Example D: Buying back too soon
Leo sold Bitcoin at a loss then bought it back three days later without realising the 30 day rule applied. His cost basis was replaced with the repurchase price which removed the loss for tax purposes.
In my opinion: the key things you need to remember
The UK uses Section 104 pooling, not FIFO.
Always apply the rules in order: same day, 30 day, then pool.
Swaps are disposals even without cashing out.
Staking, mining and many airdrops create income that becomes part of your pool.
You must convert everything into GBP on the transaction date.
Fees are allowable and should be recorded.
Good record keeping makes calculating cost basis manageable.
In my opinion once you understand the matching rules the whole system becomes much clearer and far less intimidating.
Final thoughts
Calculating your crypto cost basis in the UK requires careful record keeping and an understanding of the matching rules HMRC uses. The same day rule and 30 day rule override the pooled cost method and must always be applied first. Any remaining tokens are added to your Section 104 pool where the average cost is used for future disposals. When done correctly this method gives you an accurate cost basis and prevents issues with HMRC.
In my opinion learning the UK cost basis rules early will save you countless hours of confusion and ensure you never pay more Capital Gains Tax than necessary.