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):
- Same day: coins of the same type bought on the same day as the sale.
- 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.
- 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.
| Date | What happened | £ |
|---|---|---|
| 10 May 2025 | Sell 1 BTC | 30,000 |
| 25 May 2025 | Buy 1 BTC back | 31,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.
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 sale | Proceeds | Cost | Gain / (loss) |
|---|---|---|---|
| 0.4 BTC matched to 25 May buy (0.4 BTC for £12,400) | 12,000 | 12,400 | (400) |
| 0.6 BTC matched to the pool (£40,000 × 0.6) | 18,000 | 24,000 | (6,000) |
| Total | 30,000 | 36,400 | (6,400) |
Things that catch people out
- Swaps count as buys. If you swap ETH into BTC within 30 days of selling BTC, that BTC acquisition is matched just like a cash purchase.
- Staking rewards and airdrops of the same coin can also be acquisitions in the 30-day window.
- The order matters. Same-day matching happens first, then 30-day, then the pool. A spreadsheet that just uses "average cost" for everything will give the wrong answer.
- It works across tax years. A sale on 1 April and a buy-back on 20 April are still matched, even though the buy-back is in the next tax year.
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.
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.