Share and Crypto CGT in the UK: Same-Day, 30-Day and Section 104 Rules Explained
How HMRC matches share and crypto sales with the same-day, 30-day and Section 104 pool rules, with a worked example and how to get your CGT figure right.

Most investors think of a sale in simple terms: I bought these shares for this much, I sold them for that much, the difference is my gain. HMRC does not see it that way. Once you have bought the same share or token more than once, the units lose their individual identity, and the law decides which purchase each sale is set against. Get the order wrong and your gain can be out by thousands of pounds. This guide explains the rules in plain English and shows how to check your own trades with the free Share and Crypto CGT Calculator.
Why matching rules exist
Before 1998, investors could sell shares on the last day of the tax year to use their annual exemption and buy them back the next morning, keeping the same holding while resetting the cost to a higher figure. This was known as bed and breakfasting. Parliament closed the gap by saying that a purchase within 30 days after a sale is matched with that sale. The same thinking produced the same-day rule and the single average-cost pool for everything else.
Rule one: the same day
Anything you buy on the day you sell is matched first. All buys of one asset on that day count as one purchase, and all sells count as one disposal. If you sell 400 shares and buy 400 on the same day, the sale uses the cost of the purchase you just made, so the gain or loss is usually tiny.
Rule two: the next 30 days
If any part of the sale is still unmatched, look forward 30 days. Purchases in that window are matched next, earliest first. This is why selling and buying straight back does not crystallise a gain or loss against your old cost. If you sell twice and buy back once, the earlier sale gets first claim on the buy-back.
Rule three: the Section 104 pool
Everything else lives in the pool. Each purchase adds its units and its full cost, including commission and stamp duty, to one running total. A sale takes its cost from the pool at the average price per unit at that moment. Units that were matched under the first two rules never enter the pool.
Crypto works the same way
HMRC treats cryptoassets as property for capital gains purposes, and its cryptoassets manual applies the same three rules. Each token type has its own pool. Swapping one coin for another is a sale of the first and a purchase of the second at the sterling value on the day, and spending crypto on goods is a sale too. People are often caught out by many small swaps, each one a disposal.
A worked example
Suppose you hold 3,000 shares in one company costing £8,424 with fees. You sell 1,500 for £6,000, paying £12 commission, and two weeks later you buy 500 back for £1,912 with fees. The 500 are matched with the buy-back at £1,912. The other 1,000 come from the pool at a third of £8,424, which is £2,808. Your gain is £6,000 less £12, less £4,720: £1,268. Had you ignored the 30-day rule and taken all 1,500 from the pool at £4,212, the gain would have looked like £1,776, which is wrong.
Add a crypto sale with a gain of £11,492 and a small same-day loss of £14, and the net gain for the year is £12,746. After the £3,000 exempt amount, £9,746 is taxable. If you have £7,700 of basic rate band left, that part is taxed at 18% and the rest at 24%, giving £1,877.04.
Losses and the exempt amount
Losses in the same tax year are deducted in full before the exempt amount, even if that wastes some of it. Losses carried forward from earlier years work differently: they are only used to bring your gains down to the exempt amount, so the allowance is never wasted. A loss must be reported to HMRC within four years to be carried forward at all.
When you must report
You need to report when your gains are above the exempt amount, when your total sale proceeds are more than £50,000, or when you want to claim a loss. Most people do this on the capital gains pages of a Self Assessment return by 31 January after the tax year. Keep contract notes, exchange statements and your matching workings for at least a year after the filing deadline, and longer if you carry losses forward.
Tips for a clean record
Use the same asset name every time, so each pool stays separate and complete. Enter fees as a separate figure rather than netting them off. Convert foreign currency trades at the rate on the day. Add transfers in, airdrops and gifts received as purchases at the right value, or a later sale will show more units sold than you held. If you want to rebuy the same investment without the 30-day rule applying, buying inside an ISA or a pension, or having your spouse buy, avoids the match.
Using the calculator
Enter each trade as a row, set the tax year and your taxable income in the settings, and the ledger shows the matching for every sale, the pool history for each asset, and the tax for the year. You can print the computation, export a CSV for your return and keep the log in your browser for next year. The figures are an estimate rather than advice, so check anything unusual against GOV.UK or with a tax adviser before you file.



