How do you work out a gain or loss on crypto?
A gain is what you received, less selling fees, minus your cost basis: what you paid, including buying fees.1,2 As of October 2026, US crypto held more than one year gives a long-term gain, while the UK puts each type of token into a "section 104 pool" at an average cost, with same-day and 30-day rules.3,4
These are the IRS and HMRC rules for individuals as they stood in October 2026. Rates and allowances change, and companies follow different rules (lesson 7). Ask a qualified tax adviser.3,5,6
The basic sum
Cost basis is what you paid for crypto. The IRS says it includes the price plus the fees you paid to make the purchase.1,7 Those fees can include transaction and "gas" fees, transfer taxes and commissions.1
When you sell, the IRS works with the amount realized: the cash you received, less the fees you paid to make the sale.1 Your gain or loss is the difference between the amount realized and your basis.1,8
In short: gain or loss = (proceeds − selling fees) − (price paid + buying fees).1
A simple example. Suppose you buy 2 units for $1,000 and pay a $10 fee, so your basis is $1,010. Later you sell both for $1,500 and pay a $15 fee, so the amount realized is $1,485. Your gain is $1,485 − $1,010 = $475.1
HMRC's idea is the same. Allowable costs include the price you paid, in pounds, and transaction fees for getting the transaction onto the ledger.2 You cannot count costs already deducted for Income Tax, or mining costs such as equipment and electricity.2
US: short-term or long-term?
The IRS splits gains by how long you held the asset:3
- Held more than one year: a long-term gain or loss.3,1
- Held one year or less: a short-term gain or loss.3,1
Your holding period starts on the day after you got the crypto, and ends on the day you sell or swap it.1 IRS Publication 544 gives an example. Buy on 17 June 2024, and you start counting on 18 June 2024. Sell on 17 June 2025, and you have not held it longer than one year. Sell on 19 June 2025, and you have.9
Why it matters: for tax years beginning in 2025, the IRS says the rate on most net capital gain is no higher than 15% for most individuals, and some gain may be taxed at 0%. A 20% rate applies above certain income levels.3 Net short-term gains are taxed as ordinary income, at the usual income tax rates.3
Losses help too. If your capital losses are bigger than your gains, you can deduct up to $3,000 a year from other income ($1,500 if married filing separately), and carry the rest forward.3
Which units did you sell? For coins in a wallet you control, the IRS lets you choose which units you sell if you identify them in your records by the time of the sale.1 For coins a broker holds for you, from 2026 you must tell the broker which units by the time of the sale.1 If you don't identify units, they are treated as sold oldest first, starting with the earliest units you acquired in that wallet or account.1
UK: the section 104 pool
The UK works differently. Tokens that are dealt in without picking out particular units are pooled: each type of token goes into its own section 104 pool, named after section 104 of the UK law that sets it up. The pool has one running total of tokens and one "pooled allowable cost".4 NFTs are each different, so they are not pooled.4
GOV.UK gives this example:10
| Step | Tokens in the pool | Pooled cost |
|---|---|---|
| Buy 100 tokens at £2 each | 100 | £20010 |
| Buy 300 tokens at £1 each | 400 | £500, an average of £1.25 each10 |
| Sell 200 tokens | 200 left | Cost of the sale: 200 × £1.25 = £25010 |
You take the £250 away from what you sold the 200 tokens for, to find the gain.10 The pool then shrinks by the tokens sold and the cost taken out. In HMRC's own example, a pool of 150 tokens costing £126,000 gives up £126,000 × 50/150 = £42,000 when 50 are sold, leaving 100 tokens costing £84,000.11
UK: the same-day and 30-day rules
Two rules come before the pool.4
- Same day. If you buy and sell the same token on the same day, the sale is matched with that day's purchases first, as far as possible.4 In HMRC's example, someone sells 1,500 tokens in one day and buys 1,600 the same day. The sale is matched with 1,500 of the new tokens, at a cost of £1,000 × 1,500/1,600 = £938. The other 100 go into the pool.12
- Thirty days. If you sell and then buy the same token within the next 30 days, the new tokens are matched to the sale instead of going into the pool. Where there are several sales, the earliest sale is matched first.4 In HMRC's example, a sale on 31 March is matched with tokens bought on 21 and 28 April, not with the pool.13
So if you sell tokens and buy the same number back three weeks later, the cost of the sale is usually what you paid for the new tokens, not the pool's average.4
UK: the allowance and the rates
The UK tax year runs from 6 April to 5 April. You report and pay Capital Gains Tax if your total gains for the year are above the tax-free allowance.10 As of October 2026, that allowance, the Annual Exempt Amount, is £3,000.14 On gains from 6 April 2026, higher and additional rate taxpayers pay 24%. Basic rate taxpayers pay 18% on the part of their gains that fits within the basic Income Tax band, and 24% on the rest.5
- Frequently asked questions on digital asset transactions (Part II): gains, losses, basis and holding periods. US Internal Revenue Service (IRS), FAQs added 15 December 2025; page last reviewed or updated 29 June 2026; checked 24 October 2026.
- CRYPTO22150: Cryptoassets for individuals: Capital Gains Tax: allowable expenses. HM Revenue & Customs (HMRC), Cryptoassets Manual, manual last updated 28 November 2025; checked 24 October 2026.
- Topic no. 409, Capital gains and losses. US Internal Revenue Service (IRS), page last reviewed or updated 24 September 2026; checked 24 October 2026.
- CRYPTO22200: Cryptoassets for individuals: Capital Gains Tax: pooling. HM Revenue & Customs (HMRC), Cryptoassets Manual, manual last updated 28 November 2025; checked 24 October 2026.
- Capital Gains Tax rates. GOV.UK, checked 24 October 2026.
- CRYPTO41350: Cryptoassets for businesses: Corporation Tax on Chargeable Gains: pooling. HM Revenue & Customs (HMRC), Cryptoassets Manual, manual last updated 28 November 2025; checked 24 October 2026.
- Instructions for Form 8949 (2025). US Internal Revenue Service (IRS), 2025 tax year; checked 24 October 2026.
- Notice 2014-21: tax treatment of transactions using convertible virtual currency. US Internal Revenue Service (IRS), 2014 (Internal Revenue Bulletin 2014-16); later modified by Notice 2023-34.
- Publication 544 (2025), Sales and Other Dispositions of Assets. US Internal Revenue Service (IRS), for use in preparing 2025 returns; page last reviewed or updated 30 April 2026.
- Check if you need to pay tax when you sell cryptoassets. HM Revenue & Customs (GOV.UK guidance), last updated 5 October 2026; checked 24 October 2026.
- CRYPTO22251: pooling examples: example 1, basic section 104 pool disposal. HM Revenue & Customs (HMRC), Cryptoassets Manual, manual last updated 28 November 2025; checked 24 October 2026.
- CRYPTO22252: pooling examples: example 2, application of the same day rule. HM Revenue & Customs (HMRC), Cryptoassets Manual, manual last updated 28 November 2025; checked 24 October 2026.
- CRYPTO22253: pooling examples: example 3, application of the 30 day rule. HM Revenue & Customs (HMRC), Cryptoassets Manual, manual last updated 28 November 2025; checked 24 October 2026.
- Capital Gains Tax allowances. GOV.UK, checked 24 October 2026.
General education built from the publicly available sources listed above. Not financial, legal, tax or investment advice. Naming a company, project or regulator is not an endorsement either way. Last checked 2026-10-24. Terms and disclaimer.