What this page shows
HMRC publishes worked examples in its Self Assessment helpsheets, its Capital Gains Manual, its Cryptoassets Manual and on GOV.UK. We enter the facts of each example into the FiscalFox calculation engine and compare its answer with HMRC's. For all 19 examples below, FiscalFox gets HMRC's answer.
Each example shows the facts, HMRC's answer, our answer and a link to HMRC's page. They run as automated tests on every change to the calculation code, so these answers are checked again each time the engine changes.
- Exact to the penny (8): Our figures are the same as HMRC's.
- Matches HMRC's rounded figure (5): HMRC rounds each step to whole pounds. We keep pence, so our figure is exact to the penny, before HMRC's whole-pound rounding. The difference is always under £1. For example, in HS284 Example 3 HMRC gives a gain of £329 and FiscalFox gives £329.33.
- Same shares matched (6): HMRC says which shares a sale is matched with but gives no money figures. We check the engine matches the same shares.
HMRC has not reviewed or endorsed FiscalFox. These are HMRC's public examples, and the checks on this page are our own.
Share matching and Section 104 holdings
Sales are matched first with shares bought the same day, then with shares bought in the next 30 days, then with the Section 104 holding at its average cost.
HS284 Example 1
Five purchases, one Section 104 holding
An investor buys shares in Wilson and Strickland plc five times between 1979 and 2006. All of them form one Section 104 holding.
The facts
| Date | Event | Shares | Amount |
|---|---|---|---|
| 7 June 1979 | Buy | 2,000 | Not given |
| 4 November 1982 | Buy | 2,500 | Not given |
| 26 August 1987 | Buy | 2,500 | Not given |
| 7 July 1998 | Buy | 3,000 | Not given |
| 14 May 2006 | Buy | 2,000 | Not given |
HMRC's answer and ours
How HMRC matches it
- Every purchase joins the same Section 104 holding.
FiscalFox gives the same result.
HS284 Example 2
A sale followed by a buy-back within 30 days
Mr Schneider sells 4,000 shares and buys 500 back 12 days later. The 500 are matched under the 30-day rule and the rest come from his Section 104 holding.
The facts
| Date | Event | Shares | Amount |
|---|---|---|---|
| Before the sale | Section 104 holding | 9,500 | Not given |
| 30 August 2024 | Sell | 4,000 | £6,000 |
| 11 September 2024 | Buy | 500 | £850 |
HMRC's answer and ours
How HMRC matches it
- 500 shares sold on 30 August are matched with the 500 bought on 11 September (30-day rule).
- The other 3,500 come from the Section 104 holding.
FiscalFox gives the same result.
HS284 Example 3
Two sales from a Section 104 holding, with dealing costs
Ms Pierson buys shares twice, paying dealing costs each time, then sells part of her holding twice. Each sale takes its share of the pooled cost.
The facts
| Date | Event | Shares | Amount | Dealing costs |
|---|---|---|---|---|
| April 2016 | Buy | 1,000 | £4,000 | £150 |
| September 2019 | Buy | 500 | £2,050 | £80 |
| May 2024 | Sell | 700 | £3,360 | £100 |
| February 2025 | Sell | 400 | £2,080 | £105 |
HMRC's answer and ours
Note on HMRC's page: HMRC publishes this example for 2025 and 2026 with every date one year apart. Both give the same figures, and we check both. The 2026 PDF says the second sale was in February 2025, but its own working uses February 2026, so we follow the working.
CG51560 Example 1
Sell everything, buy it all back within 30 days
Miss A sells all 1,000 of her shares and buys 1,000 back 30 days later. The sale is matched with the new shares, not her old holding.
The facts
| Date | Event | Shares | Amount |
|---|---|---|---|
| Before the sale | Section 104 holding | 1,000 | Not given |
| 1 July 2011 | Sell | 1,000 | Not given |
| 31 July 2011 | Buy | 1,000 | Not given |
HMRC's answer and ours
How HMRC matches it
- All 1,000 shares sold are matched with the purchase on 31 July (30-day rule).
FiscalFox gives the same result.
CG51560 Example 2
Part of a sale matched with a later purchase
Mr B sells 1,700 shares and buys 500 three days later. Only 500 of the shares sold are matched with the new purchase.
The facts
| Date | Event | Shares | Amount |
|---|---|---|---|
| Before the sale | Section 104 holding | 2,500 | Not given |
| 27 March 2012 | Sell | 1,700 | Not given |
| 30 March 2012 | Buy | 500 | Not given |
HMRC's answer and ours
How HMRC matches it
- 500 shares are matched with the purchase on 30 March (30-day rule).
- The other 1,200 come from the Section 104 holding.
FiscalFox gives the same result.
CG51560 Example 3
A purchase just outside the 30 days
Mrs C sells 2,000 shares and buys 3,000 more 31 days later. The purchase is too late for the 30-day rule, so the whole sale comes from her Section 104 holding.
The facts
| Date | Event | Shares | Amount |
|---|---|---|---|
| Before the sale | Section 104 holding | 10,000 | Not given |
| 28 February 2009 | Sell | 2,000 | Not given |
| 31 March 2009 | Buy | 3,000 | Not given |
HMRC's answer and ours
How HMRC matches it
- All 2,000 shares sold come from the Section 104 holding.
FiscalFox gives the same result.
CG51590 Example 1
The 30-day rule, then the Section 104 holding
Ms Davy builds a holding with three purchases, sells 2,000 shares, buys 2,000 back within 30 days, then makes a second sale later in the year.
The facts
| Date | Event | Shares | Amount |
|---|---|---|---|
| 15 April 2006 | Buy | 1,000 | £1,300 |
| 4 August 2006 | Buy | 1,000 | £1,450 |
| 19 January 2007 | Buy | 500 | £950 |
| 16 March 2010 | Sell | 2,000 | £6,850 |
| 7 April 2010 | Buy | 2,000 | £6,790 |
| 10 December 2010 | Sell | 2,200 | £7,700 |
HMRC's answer and ours
How HMRC matches it
- The March sale is matched with the 7 April purchase (30-day rule), so those shares never join the holding.
- The December sale comes from the Section 104 holding.
FiscalFox gives the same result.
Bonus issues and takeovers
New shares from a bonus issue or a share-for-share takeover are not a new purchase. They take over the cost and date of the shares they came from.
HS285 Example 2
A 1 for 2 bonus issue
A company gives one free share for every two held. The new shares join the existing holding at no extra cost and are not treated as a new purchase.
The facts
| Date | Event | Shares | Amount |
|---|---|---|---|
| Not given | Shares held | 1,000 | Not given |
| Not given | 1 for 2 bonus issue | 500 | Nil |
HMRC's answer and ours
How HMRC matches it
- The bonus shares are not an acquisition, so the same day and 30-day rules never match a sale with them.
FiscalFox gives the same result.
HS285 Example 3
A bonus issue shortly after a sale
An investor sells 200 shares, then receives a bonus issue 27 days later. The bonus shares are not a purchase, so the sale is matched with the original shares.
The facts
| Date | Event | Shares | Amount |
|---|---|---|---|
| 6 May 2013 | Buy | 1,100 | Not given |
| 4 February 2025 | Sell | 200 | Not given |
| 3 March 2025 | 1 for 3 bonus issue | 300 | Nil |
HMRC's answer and ours
How HMRC matches it
- The 200 shares sold come from the shares bought in 2013, not the bonus shares.
FiscalFox gives the same result.
HS285 Example 6
A takeover paid in shares
One company takes over another and pays only in its own shares. The investor already owns some shares in the buyer. There is no sale, and the old cost carries over to the new shares.
The facts
| Date | Event | Shares | Cost |
|---|---|---|---|
| Not given | Shares held in the target company | 5,000 | £6,000 |
| Not given | Shares already held in the buyer | 2,000 | £8,000 |
| Not given | Takeover: 5 buyer shares for each target share | 25,000 | Nil |
HMRC's answer and ours
Cryptoassets
HMRC applies the same matching rules to tokens. HMRC writes these dates without a year, so we show the day and month only.
CRYPTO22251 Example 1
A simple sale from a token pool
Victoria buys tokens twice, then sells a third of them. The cost comes from the pool average.
The facts
| Date | Event | Tokens | Amount |
|---|---|---|---|
| Before | Opening holding | 100 | £1,000 |
| 18 September | Buy | 50 | £125,000 |
| 1 December | Sell | 50 | £300,000 |
HMRC's answer and ours
CRYPTO22252 Example 2
Two sales and a purchase on one day
Martyn sells tokens twice and buys once on the same day. Both sales are matched with that day's purchase first.
The facts
| Date | Event | Tokens | Amount |
|---|---|---|---|
| Before | Pool | 5,000 | £500 |
| 23 June | Sell | 1,000 | £800 |
| 23 June | Buy | 1,600 | £1,000 |
| 23 June | Sell | 500 | £600 |
HMRC's answer and ours
How HMRC matches it
- Both sales (1,500 tokens) are matched with the 1,600 bought that day (same day rule).
FiscalFox gives the same result.
CRYPTO22253 Example 3
Two sales matched with three later purchases
Rachel sells twice and then buys three times within 30 days. Each sale is matched with the earliest purchases in turn.
The facts
| Date | Event | Tokens | Amount |
|---|---|---|---|
| Before | Pool | 2,000 | £1,000 |
| 31 March | Sell | 1,000 | £400 |
| 20 April | Sell | 500 | £150 |
| 21 April | Buy | 700 | £175 |
| 28 April | Buy | 500 | £100 |
| 1 May | Buy | 500 | £150 |
HMRC's answer and ours
How HMRC matches it
- 31 March sale: 700 tokens from 21 April and 300 from 28 April (30-day rule).
- 20 April sale: 200 tokens from 28 April and 300 from 1 May (30-day rule).
FiscalFox gives the same result.
CRYPTO22254 Example 4
Same day purchases first, then the pool
Daniel sells and buys several times in one day. He sells more than he buys that day, so the extra comes from his pool.
The facts
| Date | Event | Tokens | Amount |
|---|---|---|---|
| Before | Pool | 8,000 | £1,000 |
| 31 January | Sell | 5,000 | £500 |
| 31 January | Buy | 4,000 | £320 |
| 31 January | Buy | 1,000 | £75 |
| 31 January | Buy | 1,000 | £70 |
| 31 January | Sell | 2,000 | £142 |
| 31 January | Buy | 500 | £35 |
HMRC's answer and ours
CRYPTO22255 Example 5
The 30-day rule, then the pool
Melanie sells 4,000 tokens and buys 500 back 12 days later. The 500 are matched under the 30-day rule and the rest come from her pool.
The facts
| Date | Event | Tokens | Amount |
|---|---|---|---|
| Before | Pool | 14,000 | £200,000 |
| 30 August | Sell | 4,000 | £160,000 |
| 11 September | Buy | 500 | £17,500 |
HMRC's answer and ours
CRYPTO22256 Example 6
Same day, 30-day and pool rules together
Gulferaz makes three sales in a week, with purchases on the first sale's day and after it. All three matching rules apply.
The facts
| Date | Event | Tokens | Amount |
|---|---|---|---|
| Before | Pool | 100,000 | £300,000 |
| 31 July | Buy | 10,000 | £45,000 |
| 31 July | Sell | 30,000 | £150,000 |
| 5 August | Sell | 20,000 | £100,000 |
| 6 August | Buy | 50,000 | £225,000 |
| 7 August | Sell | 100,000 | £150,000 |
HMRC's answer and ours
How HMRC matches it
- 31 July sale: 10,000 tokens from that day's purchase (same day rule) and 20,000 from 6 August (30-day rule).
- 5 August sale: 20,000 tokens from 6 August (30-day rule).
- 7 August sale: all from the pool.
FiscalFox gives the same result.
CRYPTO22257 Example 7
Token for token exchanges across two pools
Elina swaps one token for another six times. Each swap is a sale of one token and a purchase of the other, so both pools change.
The facts
| Date | Gives | Receives | Values used |
|---|---|---|---|
| 31 August | 1,000 token G | 10,000 token H | G £3,200, H £3,200 |
| 31 August | 5,000 token H | 600 token G | H £1,700, G £1,920 |
| 31 August | 550 token G | 5,000 token H | G £1,760, H £1,650 |
| 4 September | 2,000 token H | 180 token G | H £560, G £558 |
| 16 September | 400 token G | 4,000 token H | G £1,080, H £1,080 |
| 27 October | 12,000 token H | 900 token G | H £2,400, G £2,430 |
HMRC's answer and ours
Note on HMRC's page: HMRC's text says the 180 token G received on 4 September go into the token G pool. Under the 30-day rule they are matched with the 31 August disposal instead, and HMRC's own pool table leaves them out. We follow the table.
Tax on the year's gains
After the annual exempt amount, gains are taxed at 18% within the basic rate band and 24% above it.
GOV.UK rates Example 1
Gains that fit inside the basic rate band
In 2026 to 2027, someone with £20,000 of taxable income makes £12,600 of gains. After the £3,000 allowance, all the taxable gain falls in the basic rate band.
The facts
| Item | Amount |
|---|---|
| Tax year | 2026 to 2027 |
| Taxable income | £20,000 |
| Gains | £12,600 |
HMRC's answer and ours
GOV.UK rates Example 2
Gains split across the basic and higher rates
The same person makes £52,600 of gains instead. Part of the taxable gain is taxed at 18% and the rest at 24%.
The facts
| Item | Amount |
|---|---|
| Tax year | 2026 to 2027 |
| Taxable income | £20,000 |
| Gains | £52,600 |
HMRC's answer and ours
What this does not cover
The calculator does not cover indexation allowance (used for older disposals and by companies), splitting cost between different classes of share, qualifying corporate bonds, residential property rates, or gains made by companies. HMRC examples on those topics are not on this page. Nor are examples we can only reproduce by entering the facts in a special way.
Matching HMRC's examples shows the rules are applied correctly. It cannot show that a broker export is complete, so FiscalFox still flags missing history and unusual rows for you to review. Read the calculation methodology for more.
Sources and licence
Each example links to the HMRC or GOV.UK page it comes from. We describe each scenario in our own words and quote HMRC's figures. Where HMRC's page has a slip, we say so in a note and use the figure HMRC's own working supports.
Contains public sector information licensed under the Open Government Licence v3.0.
Official UK tax references
This guide is checked against published GOV.UK and HMRC material. FiscalFox is a calculation tool, not personal tax advice; review unusual transactions with a qualified adviser.