ukcapitalgains

Guides · 2026–27 tax year

Section 104: How to Work Out the Average Cost of Your Shares

When you've bought the same shares more than once, at different prices, how do you know what the shares you sold cost you? For most sales, HMRC's answer is to use the average. This guide shows how, step by step.

Illustration of stacks of shares pouring into a single pool with an average level

Please read

This guide is for general information only. It is not financial or tax advice, and it may contain mistakes or leave out rules that apply to you. It covers shares and funds only, not property, crypto or business assets. Check with HMRC or a qualified adviser before making decisions.

What is the Section 104 holding?

Imagine putting all your shares in one company into a single pot, along with everything you paid for them. That pot is what HMRC calls a Section 104 holding, or a "pool". The name comes from the section of the tax law that sets it up.

Every share in the pot is treated as if it cost the same: the average cost. You don't have to track which exact shares you sold.

You have a separate pool for each company, and for each type of share in that company. Shares in an ISA or pension don't go in the pool, because they are free of Capital Gains Tax.

What counts as the cost

The cost of the shares you buy is more than just the share price. You add:

  • the price you paid for the shares
  • the dealing fee your broker charged for the purchase
  • any stamp duty (Stamp Duty Reserve Tax) you paid when buying

Fees for selling don't go in the pool. They are taken off the money you get from the sale instead. Either way, fees reduce your gain, so it's worth including them.

Building the pool when you buy

Each time you buy, add the shares to the pool and add what they cost to the pool's total cost. Then divide the total cost by the number of shares to get the average.

Step 1: first purchase

Buy 100 shares at £10
£1,000
Dealing fee
£5
Pool: 100 shares, total cost
£1,005

Step 2: second purchase

Buy 50 more shares at £12
£600
Dealing fee
£5
Add to the pool: £1,005 + £605
£1,610
Pool: 150 shares, average £1,610 ÷ 150
£10.73 each

The average is rounded to the nearest penny here. It's best to keep working with the total cost, which avoids rounding errors.

Working out the cost when you sell

When you sell some shares, you take a share of the pool's total cost that matches the share of the pool you sold.

Cost of shares sold = total pool cost × (shares sold ÷ shares in the pool)

Step 3: selling 60 shares at £15

Money from the sale: 60 × £15
£900
Selling fee
−£5
Cost from the pool: £1,610 × (60 ÷ 150)
−£644
Gain
£251

Then take those shares and their cost out of the pool:

The pool after the sale

Shares: 150 − 60
90
Total cost: £1,610 − £644
£966
Average cost: £966 ÷ 90
£10.73 each

Notice the average cost hasn't changed. Selling never changes the average. Only buying does.

Buying more after a sale

If you buy more later, add them to what's left in the pool in the same way. (If you buy within 30 days of a sale, a different rule applies. See the next section.)

Step 4: buying 40 more shares at £14, two months later

Buy 40 shares at £14
£560
Dealing fee
£5
Pool: 90 + 40 = 130 shares, total cost £966 + £565
£1,531
New average cost: £1,531 ÷ 130
£11.78 each

When the pool isn't used

The pool is the last of HMRC's three matching rules. Before using it, a sale is matched with:

  1. Shares bought the same day as the sale.
  2. Shares bought in the 30 days after the sale (the "bed and breakfast" rule).

Those shares use their own actual cost, not the average, and they never join the pool. So if you sell and buy back within 30 days, your gain is worked out using the price you bought back at. Our guide to the 30-day rule has worked examples.

Things that change the pool

  • Share splits and bonus issues. You get more shares but pay nothing extra, so the number of shares goes up and the total cost stays the same. For example, a 2-for-1 split turns 90 shares costing £966 into 180 shares costing £966, an average of £5.37.
  • Rights issues. If you pay for extra shares offered by the company, add the new shares and what you paid to the pool.
  • Accumulation funds. In accumulation ("Acc") funds, income is reinvested for you rather than paid out. Where you pay income tax on that income, HMRC lets you add it to your cost, which lowers your gain. Your platform's annual tax statement usually shows these amounts.
  • Takeovers and mergers. These have their own rules and can move your cost into shares of the new company.

Our calculator doesn't adjust for these automatically. HMRC's helpsheet HS285 covers company changes in more detail.

Why your broker's figure might be different

Many platforms show a "book cost" or "average price". It's a useful check, but it isn't always the figure HMRC uses. Platforms may leave out fees, may not apply the same-day and 30-day rules, and may treat reinvested income differently.

Keep your own record of every purchase and sale, with dates, prices and fees. You can paste those trades into our calculator, which builds the pool and applies the matching rules for you.

Work out your own CGT

Paste your trades from your broker and see your gain, allowance and tax in seconds.

Open the calculator →

Sources on GOV.UK: Work out your gain on shares, Selling shares in the same company, HS284 Shares and Capital Gains Tax. Last checked 23 September 2026.

This is an estimate, not financial or tax advice. It may contain mistakes and does not cover every situation, so check your figures with HMRC or a qualified adviser before you rely on them.