Worked Examples

Step-by-step calculations showing how HMRC matching rules work in practice.

1. Basic buy and sell

You buy 100 shares of AAPL at £50 each, then later sell 60 at £80 each. No same-day or B&B rules apply, so the disposal is matched entirely against the Section 104 pool.

Trades

DateTypeQtyPriceTotal
2024-01-15Buy100£50.00£5,000.00
2024-06-20Sell60£80.00£4,800.00

Calculation

Pool after buy: 100 shares @ £5,000 total cost (avg £50/share)

Disposal matched to pool: 60 shares. Allowable cost = 60/100 × £5,000 = £3,000.

Proceeds: 60 × £80 = £4,800

Gain: £4,800 − £3,000 = £1,800

Pool after sale: 40 shares @ £2,000 total cost (avg £50/share)

2. Same-day rule

On the same day, you buy 50 shares of MSFT at £100, sell 30 at £110, and buy another 20 at £105. The same-day rule matches the sale against same-day acquisitions.

Trades (all on 2024-03-10)

TypeQtyPriceTotal
Buy50£100.00£5,000.00
Sell30£110.00£3,300.00
Buy20£105.00£2,100.00

Calculation

Same-day acquisitions: 50 + 20 = 70 shares acquired on this day, total cost £7,100.

Same-day match: The 30-share disposal is matched against same-day acquisitions. Allowable cost = 30/70 × £7,100 = £3,042.86.

Proceeds: 30 × £110 = £3,300

Gain: £3,300 − £3,042.86 = £257.14

Pool after same-day netting: 70 − 30 = 40 shares enter the pool with cost £7,100 − £3,042.86 = £4,057.14.

Note: without the same-day rule, if the sell had matched the pool (which was empty before today), the result would be different. The same-day rule ensures intraday trades are effectively netted.

3. Bed & breakfast rule

You hold 200 shares of VOD in your pool at an average cost of £80 per share. You sell 40 on January 10, then buy 40 back on January 25 (15 days later, within the 30-day window). The B&B rule overrides the pool match.

Trades

DateTypeQtyPriceTotal
2024-01-10Sell40£70.00£2,800.00
2024-01-25Buy40£72.00£2,880.00

Calculation

Without B&B (pool match): Cost would be 40 × £80 = £3,200. Loss would be £2,800 − £3,200 = −£400.

With B&B rule: The Jan 25 buy is within 30 days of the Jan 10 sale, so the disposal is matched against the repurchase instead.

Allowable cost (B&B): 40 × £72 = £2,880

Proceeds: 40 × £70 = £2,800

Loss: £2,800 − £2,880 = −£80

Effect on pool:The pool is unaffected — it remains at 200 shares @ £80 avg. The 40 repurchased shares do not enter the pool because they were consumed by the B&B match.

The B&B rule prevented a £400 loss from being crystallised. Instead, only an £80 loss is recognised. This is HMRC's mechanism to prevent "bed and breakfasting" — selling shares to realise a loss and immediately buying them back.

4. Spouse transfer with same-day buy

You hold 100 shares of TSLA in your Section 104 pool at an average cost of £50 per share. On May 1, you buy 30 more shares at £200, and on the same day transfer 30 shares to your spouse. The same-day rule applies to the transfer.

Trades

DateTypeQtyPriceTotal
Existing pool: 100 shares @ £50 avg = £5,000 total cost
2024-05-01Buy30£200.00£6,000.00
2024-05-01Transfer30

Calculation

Same-day rule applies: The transfer (disposal) on May 1 is matched against the same-day acquisition of 30 shares at £200.

Cost basis transferred to spouse: 30 × £200 = £6,000. The spouse inherits this as their cost basis for the 30 shares.

Your gain: £0 (no-gain/no-loss transfer — proceeds are deemed equal to cost).

Your pool after transfer: The original 100 shares @ £5,000 remain untouched. The same-day buy was consumed by the transfer match and never enters your pool.

This is a key subtlety: without the same-day rule, the transfer would have matched the pool at £50/share, giving the spouse a cost basis of £1,500 for 30 shares. Instead, the same-day rule gives them a cost basis of £6,000 — significantly different for their future disposal calculations.

5. Multiple tax years with Annual Exempt Amount

You make disposals across two tax years. Each year has its own Annual Exempt Amount (AEA) that offsets gains before tax is due.

Trades

DateTypeSymbolQtyPrice
2023-06-01BuyVWRL500£80.00
2024-02-15SellVWRL200£95.00
2024-09-10SellVWRL150£102.00

Calculation

Tax Year 2023/24 (6 Apr 2023 – 5 Apr 2024)

Disposal: 200 shares on 2024-02-15

Proceeds: 200 × £95 = £19,000

Allowable cost (from pool): 200/500 × £40,000 = £16,000

Gain: £19,000 − £16,000 = £3,000

AEA for 2023/24: £6,000

Taxable gain: £3,000 − £6,000 = £0 (fully covered by AEA)

Tax Year 2024/25 (6 Apr 2024 – 5 Apr 2025)

Pool at start of year: 300 shares @ £24,000 (avg £80/share)

Disposal: 150 shares on 2024-09-10

Proceeds: 150 × £102 = £15,300

Allowable cost (from pool): 150/300 × £24,000 = £12,000

Gain: £15,300 − £12,000 = £3,300

AEA for 2024/25: £3,000

Taxable gain: £3,300 − £3,000 = £300

The AEA cannot be carried forward or back — it applies only to the tax year in which the disposal occurs. In 2023/24, the £6,000 allowance more than covered the £3,000 gain (the excess £3,000 is lost). In 2024/25, the reduced £3,000 AEA only partially offsets the gain, leaving £300 taxable.

This is where the AEA optimiser is useful: if you had split the second sale so that the gain in 2024/25 stayed at or below £3,000, you could have avoided any tax liability entirely.