Share Matching & Section 104 Pools

When you sell shares bought at different times and prices, HMRC’s share identification rules determine which shares you’ve disposed of — and therefore your allowable cost.

#GoFile — HMRC-recognised, free to try.

Try Free →

Key facts

  • Shares sold are matched in a strict order: same-day acquisitions first, then 30-day acquisitions, then the section 104 pool.
  • The section 104 pool is a running weighted-average cost of all your shares in a company (excluding same-day and 30-day matches).
  • The 30-day rule prevents “bed and breakfasting” — selling and rebuying shares purely to crystallise a loss.
  • Each company’s shares are pooled separately — you maintain a different section 104 pool for each holding.

Why Share Matching Matters

If you buy 1,000 shares in a company on five separate occasions at five different prices, and then sell 500 shares, which 500 did you sell? Unlike, say, selling a house (where the asset is unique), shares in the same company are fungible — each share is identical to every other.[1]

HMRC’s share identification rules solve this problem by prescribing a strict matching order. Getting this right is essential because the base cost you use directly affects the size of your gain or loss.

The Three Matching Rules

When you dispose of shares, HMRC matches the shares sold against acquisitions in this order:[1]

PriorityRuleDescription
1stSame-day ruleMatch against shares in the same company acquired on the same day as the disposal.
2nd30-day ruleMatch against shares acquired within the following 30 days (FIFO basis).
3rdSection 104 poolMatch against the pooled average cost of all remaining shares held in that company.

Each rule is applied in sequence. Only shares that are not matched under an earlier rule fall through to the next one.

Rule 1: Same-Day Acquisitions

If you buy and sell shares in the same company on the same day, the shares sold are matched with the shares bought that day. This prevents you from manipulating gains or losses by carrying out same-day transactions.[1]

Example: Same-Day Match

On 15 July 2025, James sells 200 shares in XYZ plc for £10 each (£2,000). On the same day, he buys 200 shares in XYZ plc for £9.50 each (£1,900). The disposal is matched with the same-day acquisition:

ItemAmount
Sale proceeds (200 × £10)£2,000
Less: cost of same-day acquisition (200 × £9.50)−£1,900
Gain£100

Rule 2: The 30-Day Rule (Bed and Breakfasting)

If the same-day rule does not match all shares sold, any unmatched shares are next matched against acquisitions in the same company within the following 30 days, on a first-in, first-out (FIFO) basis.[3]

This rule exists to prevent “bed and breakfasting” — the practice of selling shares to crystallise a loss and immediately buying them back. Before this rule was introduced, investors could harvest losses for tax purposes without actually changing their investment position.

Example: 30-Day Match

On 1 September 2025, Emma sells 1,000 shares in DEF plc for £5 each (£5,000). Her section 104 pool cost for those shares is £8,000 — so she would make a loss of £3,000. However, on 20 September 2025, she buys 1,000 shares in DEF plc for £5.20 each (£5,200).

Because the repurchase falls within 30 days, the disposal is matched with the new acquisition:

ItemAmount
Sale proceeds (1,000 × £5)£5,000
Less: cost of 30-day acquisition (1,000 × £5.20)−£5,200
Loss−£200

Emma’s loss is only £200 (not the £3,000 she would have claimed using her pool cost). The section 104 pool retains the original cost of £8,000 for the shares that were not matched.

Tip: To avoid the 30-day rule, wait at least 31 days before rebuying the same shares. Alternatively, consider buying a different (but similar) investment, or repurchasing within a tax-free wrapper such as an ISA (a strategy known as “Bed and ISA”).

Rule 3: The Section 104 Pool

Any shares not matched by the same-day or 30-day rules are matched against the section 104 holding. This is a single, pooled calculation that combines all your acquisitions (and part-disposals) of shares in the same company into one pool with a weighted-average cost.[2]

The section 104 pool works as follows:

  • Each time you buy shares, the number of shares and total cost are added to the pool
  • Each time you sell shares (not matched by rules 1 or 2), a proportionate number and cost are removed from the pool
  • The cost per share is recalculated after each acquisition
  • Incidental costs (broker fees, stamp duty) are included in the pool cost

Worked Example: Building and Using a Section 104 Pool

Rachel buys shares in MNO plc over several years:

DateTransactionSharesPriceCostPool SharesPool CostAvg Cost/Share
Mar 2020Buy500£4.00£2,000500£2,000£4.00
Nov 2021Buy300£6.00£1,800800£3,800£4.75
Jun 2023Buy200£5.00£1,0001,000£4,800£4.80

In December 2025, Rachel sells 600 shares at £8.00 each (£4,800 proceeds). She does not buy any MNO shares on the same day or within 30 days, so the section 104 pool applies:

ItemAmount
Sale proceeds (600 × £8.00)£4,800
Less: pool cost (600 ÷ 1,000 × £4,800)−£2,880
Gain£1,920

After the disposal, Rachel’s updated pool is:

Pool SharesPool CostAverage Cost/Share
400£1,920£4.80

Combined Example: All Three Rules

This example shows all three matching rules in action:

Tom holds 2,000 shares in PQR plc in his section 104 pool at an average cost of £3.00 per share (total pool cost £6,000). On 10 October 2025:

  • He sells 1,500 shares at £7.00 each (£10,500)
  • He buys 200 shares at £7.10 on the same day (10 October)
  • He buys 300 shares at £7.30 on 25 October (within 30 days)

The 1,500 shares sold are matched as follows:

RuleShares MatchedCostProceedsGain
Same-day (200 bought 10 Oct)200£1,420£1,400−£20
30-day (300 bought 25 Oct)300£2,190£2,100−£90
Section 104 pool (remaining 1,000)1,000£3,000£7,000£4,000
Total1,500£6,610£10,500£3,890

After the disposal, Tom’s section 104 pool contains 1,000 shares at a cost of £3,000 (the original 2,000 minus the 1,000 matched from the pool). The 200 same-day shares and 300 30-day shares do not enter the pool — they were matched directly.

Important: The 30-day rule matches against shares bought after the sale, not before. This is a common point of confusion. Shares bought before the sale (other than on the same day) are already in the section 104 pool.

Special Cases

Bonus and Rights Issues

Bonus shares (scrip issues) are added to the section 104 pool at nil cost, increasing the number of shares but not the pool cost. Rights issues are added at the price paid for the new shares.[4]

Share Reorganisations

Where a company reorganises its share capital (e.g. a share split or consolidation), the pool is adjusted to reflect the new number of shares, but the total cost remains the same.

Shares in Different Classes

Different classes of shares in the same company (e.g. ordinary shares and preference shares) are treated as separate assets. Each class has its own section 104 pool.

Frequently Asked Questions

What is a section 104 pool?

A section 104 pool (or “section 104 holding”) is the default method HMRC uses to calculate the base cost of shares. It combines all your acquisitions of shares in the same company into a single pool with a weighted-average cost per share. Each time you buy more shares, the pool grows; each time you sell, a proportionate cost is deducted.

What is the 30-day rule for shares?

The 30-day rule (also called the “bed and breakfasting” rule) matches shares you sell with any shares in the same company that you buy within the following 30 days. This prevents you from selling shares to realise a loss and immediately rebuying them. The cost of the new shares becomes the base cost for the disposal.

Do the share matching rules apply to funds and ETFs?

Yes. The same matching rules apply to units in unit trusts, shares in OEICs, and shares in ETFs. Each fund is treated as a separate holding with its own section 104 pool.

How do I keep track of my section 104 pool?

You should maintain a record of every purchase and sale, updating the pool after each transaction. Record the date, number of shares, price per share, total cost (including dealing costs), and the running pool totals. HMRC may ask for these records if they enquire into your return.

Further Reading

Looking for simple tax software?

#GoFile is HMRC-recognised and trusted by 50,000+ UK businesses. Set up in minutes, file with confidence.

Get Started For Free

No credit card required · Cancel anytime

Sources

  1. Capital Gains Manual: CG51500 – Share identification rules — HMRC
  2. Capital Gains Manual: CG51560 – Section 104 holdings — HMRC
  3. Capital Gains Manual: CG51550 – Acquisitions within following 30 days — HMRC
  4. HS284: Shares and Capital Gains Tax — HMRC

Ready to file?

Start filing Capital Gains Tax returns today

#GoFile is HMRC-recognised software used by 50,000+ UK businesses. Set up in minutes — no accountancy knowledge needed.

Get Started Free →

No credit card required · Cancel anytime

Have a question?

Our UK-based team has helped thousands of businesses with Capital Gains Tax filing. We’re happy to help.

Contact our team