Gainsheet · UK crypto tax, worked out

The 30-day rule for crypto: a worked example

Sold crypto at a loss, then bought the same coin back a couple of weeks later? HMRC matches your sale to the new purchase, so most of the loss you were counting on disappears. Here's exactly how it works, in pounds.

The rule in one paragraph

When you dispose of a cryptoasset, HMRC doesn't let you pick which coins you sold. It matches the disposal in a fixed order (CRYPTO22200):

  1. Same day: coins of the same type bought on the same day as the sale.
  2. Next 30 days: coins of the same type bought in the 30 days after the sale (earliest first). This is the "bed and breakfasting" or 30-day rule.
  3. Section 104 pool: everything else, at your average cost. See how the Section 104 pool works.

The 30-day rule exists to stop people selling at a loss just before the tax year ends and buying straight back, so they bank a tax loss without really changing their position.

Worked example

You own 1 BTC. You bought it a while ago for £40,000, so your Section 104 pool is 1 BTC with a cost of £40,000.

DateWhat happened£
10 May 2025Sell 1 BTC30,000
25 May 2025Buy 1 BTC back31,000

What you might expect

Proceeds £30,000 minus cost £40,000 = a £10,000 loss.

What HMRC actually does

The 25 May purchase falls within 30 days after the sale, so the sale is matched with it, not with your pool.

Step£
Proceeds (10 May sale)30,000
Matched cost (25 May buy)(31,000)
Allowable loss(1,000)

Your loss is £1,000, not £10,000. And your Section 104 pool is untouched: it is still 1 BTC at a cost of £40,000. That's the coin you're now treated as holding.

So is the £9,000 lost forever? Usually not. It's still sitting in your pool cost. When you eventually sell that BTC, the £40,000 cost reduces your gain then. The 30-day rule mostly moves the loss into a later year; it doesn't delete it. But if you were relying on the loss this year (to cover other gains, say), the timing matters a lot.

Partial buy-backs

If you'd bought back only 0.4 BTC on 25 May, only 0.4 of the sale would be matched with it. The other 0.6 BTC would be matched with the pool at its average cost:

Part of the saleProceedsCostGain / (loss)
0.4 BTC matched to 25 May buy (0.4 BTC for £12,400)12,00012,400(400)
0.6 BTC matched to the pool (£40,000 × 0.6)18,00024,000(6,000)
Total30,00036,400(6,400)

Things that catch people out

Doing this for a whole year of trades

For one sale it's easy. For a year of exchange trades, with swaps, partial buy-backs and fees, it gets fiddly fast. That's what Gainsheet is for: an Excel workbook that applies the same-day, 30-day and Section 104 rules in order, converts at Bank of England rates, and shows every match as a visible formula. It's useful whether you're doing your return yourself or checking what your software (or accountant) came up with.

Free: the 7 rules that decide your UK crypto tax bill, on one page.
Get the free cheat sheet See the workbook (£39)

FAQ

Does the 30-day rule apply to crypto in the UK?

Yes. HMRC applies the same matching rules to cryptoassets as it does to shares. See CRYPTO22200 onwards.

Does buying a different coin avoid it?

The rule matches disposals with acquisitions of the same type of token, so a different token isn't matched. Check HMRC's guidance on what counts as the same asset for your situation.

What about buying back before the sale?

Purchases before the sale (other than on the same day) go into the Section 104 pool and are matched at average cost. The 30-day rule only looks forward.