Sell some of a holding built up over years and the gain depends on which shares you are treated as selling. You do not choose — a fixed order of rules decides.
If you buy the same share three times over five years at different prices and then sell half your holding, what was the cost of what you sold? Left to yourself you would pick whichever answer produced the outcome you wanted. The share matching rules exist to stop that, and they apply in a fixed order that overrides intention entirely.
The Three Rules, In Order
- Same day. A disposal is matched first against any acquisition of the same shares on the same day.
- The following 30 days. Next, against acquisitions in the 30 days after the disposal. This is the rule that stops selling and immediately rebuying to crystallise a gain or a loss.
- The section 104 pool. Anything left is matched against the pool: all remaining shares of that class treated as a single asset with a single average cost.
The pool is an average, not a queue. There is no first-in-first-out. Every acquisition adds its cost to the pool and its shares to the count; every disposal removes a proportionate slice of the pooled cost. This is why the base cost of a long-held holding is rarely a number you can find on any single contract note.
Why the 30-Day Rule Exists
| What you do | What the rules do |
|---|---|
| Sell, then rebuy the same shares within 30 days | Matched against the repurchase — little or no gain or loss |
| Sell, then rebuy after 30 days | Matched against the pool — the gain or loss stands |
| Sell, then buy the same shares inside an ISA | Different capacity — the disposal stands |
| Sell, then your spouse buys the same shares | A different person — the disposal stands |
The second and third rows are why bed and ISA works and why the older practice of selling and rebuying on the open market to use an annual exemption does not.
What the Pool Includes
- Purchase price plus dealing costs on every acquisition.
- Reinvested dividends, which are acquisitions and add to the pool. Accumulation funds are the classic trap: income is reinvested inside the fund and forms part of your base cost even though no cash moved.
- Rights issues and scrip, which have their own treatment.
- Shares acquired from an employer at the value already taxed as employment income — see share options and RSUs.
Failing to add reinvested dividends to the pool is one of the most common errors in a self-prepared capital gains computation, and it always overstates the gain — meaning it costs you money rather than HMRC.
These Rules Apply to More Than Shares
Pooling and matching apply to fungible assets generally, which includes units in funds and crypto tokens. Anyone computing crypto gains is using these rules whether they know it or not, and the exchange reports that show individual trades are not the same as a pooled computation — see crypto and leaving the UK and crypto tax in the UK.
Keeping Records That Survive
- Keep every contract note, including reinvestments, for as long as you hold the asset and for years afterwards.
- Maintain a running pool per holding: shares held, total pooled cost. Update it at every transaction rather than reconstructing later.
- Record corporate actions — splits, consolidations, takeovers — which change the number of shares without a purchase.
- Export from platforms before you leave them. Historic data disappears when accounts close.
- Note transfers between spouses, which pass at the transferor's pooled cost rather than at market value.
Once the pool is right, the gain is arithmetic. Almost every difficult capital gains computation is difficult because the records were not kept, not because the rules are hard.
Frequently Asked Questions
Can I choose which shares I sold?
No. The matching rules apply in a fixed order: same day first, then acquisitions in the following 30 days, then the section 104 pool. Your intention does not affect the outcome.
What is the section 104 pool?
All your remaining shares of a class treated as one asset with a single averaged cost. A disposal removes a proportionate share of the pooled cost rather than any particular purchase.
Do reinvested dividends count towards my base cost?
Yes, and forgetting them is one of the most common errors. They are acquisitions and add to the pool, including inside accumulation funds where no cash changes hands.
Do these rules apply to crypto?
Yes. Pooling and matching apply to fungible assets generally, so crypto gains are computed on a pooled basis rather than trade by trade as exchange reports often show.
Related Guides
Keep reading with these related guides and calculators:
- Bed and ISA — why the 30-day rule does not block it
- Claiming capital losses — the other half of the computation
- Crypto and leaving — pooling applied to tokens
- Share options and RSUs — base cost from employment income
- CGT when you leave — when the gain is in UK charge
Check your take home pay
See exactly what you'll earn after tax with our free calculator.
Calculate Your Take Home Pay →