Table of contents
The number in your app is not your cost
I bought the same holding three times over three years, sold most of it in June, and opened the broker app expecting the tax answer to be sitting there. It was not. The app showed an average price, a profit figure and a nice green percentage, and not one of those numbers is what goes on a tax return.
The gap is not a bug in the app. It comes from the fact that the pool HMRC cares about belongs to you, not to your account. HS284 puts it plainly: all shares of the same class, in the same company, are held together in a Section 104 holding, and each share in that holding is treated as if acquired at the same average cost. If you hold the same company at two brokers, your broker knows about half your pool. It will still print an average price for that half and it will be wrong.
Then there is the ordering problem, which is worse, because it is invisible. You do not get to choose which shares you sold. HMRC decides that for you, in a fixed sequence, and the sequence is not first-in-first-out. That is the part this page is really about. Everything before it is arithmetic.
This is general information and not tax advice. Tax treatment depends on your individual circumstances, the rules change from year to year, and anyone with a position more complicated than the examples here is better off with an accountant than with a web page.
The order HMRC matches your shares in
A disposal of shares is matched against acquisitions in a set order, and each step has its own legislation behind it.
First, shares of the same class acquired on the same day as the disposal. HMRC states the rule in CG51560 as: if there is an acquisition and a disposal on the same day the disposal is identified first against the acquisition on the same day. The authority is section 105(1) of the Taxation of Chargeable Gains Act 1992. Note that this works on days, not on times, so a morning sale can be matched to an afternoon purchase.
Second, shares of the same class acquired in the 30 days after the disposal. This is section 106A(5), and CG51560 says it has priority over all other identification rules except the same day rule. Three conditions have to hold: the shares are of the same class, they are acquired by the same person in the same capacity, and the acquisition falls inside the 30 days after the disposal. Section 106A(5A) disapplies it where the buyer was not UK resident at the time of the acquisition.
Third, the Section 104 pool. HMRC describes the pool in CG51575 as a single pool of expenditure whose shares are indistinguishable parts of a single asset which grows or shrinks as shares are acquired or disposed of.
Fourth, and only if shares are still unmatched after all that, later acquisitions taken earliest first. This step only bites when you sell more shares than you hold at the time of sale.
One carve-out. Relevant securities do not pool at all. CG51565 defines those as securities within the accrued income scheme, qualifying corporate bonds, and certain interests in a non-reporting fund, and states that they do not form part of a Section 104 holding. Ordinary shares in a listed company are not relevant securities. If you hold an offshore fund without UK reporting status, take advice, because the treatment there differs in kind rather than in degree.
A Section 104 pool, worked from the start
Take one holding in one company, bought three times, then partly sold. No same-day trades and no repurchases, so the pool is the only rule in play. Dealing commission of £9.95 goes into the cost each time, because section 38 of TCGA 1992 allows the incidental costs of acquisition and disposal.
Read the average column down the page. It moves to £8.2249, then to £9.5383, then to £9.5248, and then it stops moving. A purchase changes the average because it adds shares and cost in a ratio different from the existing pool. A sale does not, because it removes shares and cost in exactly the pool ratio. That is the single most useful thing to understand about a Section 104 holding, and once you have it the arithmetic follows on its own.
Now the disposal itself. On 12 June 2026 the pool stood at 800 shares and £7,619.85 of expenditure. Selling 500 at £13.10 raises £6,550.00, less £9.95 commission, so net proceeds are £6,540.05.
The allowable cost uses the fraction HS284 gives for part disposals: the number of shares sold divided by the total number of shares in the holding. So 500 divided by 800, applied to £7,619.85, is £4,762.41.
The gain is £6,540.05 minus £4,762.41, which is £1,777.64. Against a £3,000 annual exempt amount and no other disposals that year, nothing is payable.
The pool afterwards holds 300 shares and £2,857.44, which is £7,619.85 less the £4,762.41 taken out. Divide £2,857.44 by 300 and you get £9.5248, the same average as before the sale. If your own working does not close that loop, you have made an error somewhere upstream, and that check has caught more of my mistakes than any other.
What the 30-day rule does to that answer
Same pool, same sale, one change. On 25 June 2026, thirteen days after selling, you buy 200 shares back at £12.40 plus £9.95 commission, for £2,489.95. The trade looks unrelated. The tax computation is now a different shape.
There is no same-day acquisition, so step one passes. Step two catches 200 of the 500 shares sold, because the repurchase falls inside the 30 days after the disposal and everything else about it matches. Those 200 are measured against the repurchase price, not against the pool. The other 300 fall through to the pool as normal.
Proceeds split in the same proportion. 200 of 500 shares carries 200/500 of £6,540.05, which is £2,616.02. The remaining 300 carries £3,924.03. Those two add back to £6,540.05.
On the matched slice: £2,616.02 of proceeds against £2,489.95 of cost gives a gain of £126.07. On the pooled slice: £3,924.03 of proceeds against 300/800 of £7,619.85, which is £2,857.44, gives a gain of £1,066.59. Total gain £1,192.66, against £1,777.64 if you had ignored the rule and pooled the lot.
Follow the pool through and it reconciles. The 300 pooled shares come out at £2,857.44, so the pool is left with 500 shares and £4,762.41. The 200 repurchased shares never enter the pool at all, because the matching consumed them. You hold 500 shares and the pool says 500 shares at an average of £9.5248. Nothing has leaked.
The £584.98 the rule took off this year's gain is not a saving. It sits in a pool whose cost is now lower relative to the shares in it, and it comes back the next time you sell. The rule moves gains and losses around in time. It does not create or destroy them.
Reverse the prices and you see why the rule exists. Say the pool is 1,000 shares at £14,000, an average of £14.00. You sell the lot on 2 March 2027 for £9,000, planning to book a £5,000 loss against gains made earlier in the year, and you buy 1,000 shares back on 9 March for £9,150 because you still want the position. All 1,000 shares are matched to the 9 March purchase. The loss is £9,000 minus £9,150, which is £150. The £14,000 pool is untouched and still sitting there against 1,000 shares. You spent two dealing commissions and a week of price risk to convert a £5,000 loss into a £150 one.
Where the gain lands on top of your income
The rate on a share gain is not a property of the gain. It depends on how much room is left in your basic rate income tax band once your income has filled it. GOV.UK sets out the steps: work out your taxable income, work out your total taxable gains, deduct the tax-free allowance from the gains, add what is left to your taxable income, and if the amount is within the basic income tax band you pay 18% on the gains made from 6 April 2026, with 24% on any amount above the band.
Those main rates went to 18% and 24% for disposals made on or after 30 October 2024, up from 10% and 20%, under the rate change published by HMRC. Residential property already sat at 18% and 24% and was left alone. HMRC's rates and allowances table shows 18% and 24% for individuals for 2025 to 2026 and again for 2026 to 2027, and the annual exempt amount at £3,000 across 2024 to 2025, 2025 to 2026 and 2026 to 2027.
Here is the straddle, on 2026 to 2027 figures. GOV.UK gives a personal allowance of £12,570 and a basic rate band running to £50,270, so the basic rate limit is £37,700 of taxable income.
Salary of £42,000. Taxable income after the personal allowance is £29,430, which leaves £8,270 of basic rate band unused. Net gains for the year of £15,000, less the £3,000 annual exempt amount, gives a taxable gain of £12,000.
The first £8,270 of that gain fills the remaining basic rate band and is taxed at 18%, which is £1,488.60. The other £3,730 sits above the band and is taxed at 24%, which is £895.20. The bill is £2,383.80.
Compare the two ends. Taxed entirely at 18% the same gain costs £2,160. Taxed entirely at 24% it costs £2,880. The £8,270 of headroom is worth £496.20, and it is the reason a pay rise or a large dividend in the same tax year changes what a sale costs. It also means the rate depends on facts you may not know until the tax year has ended.
One allocation point from the same GOV.UK page: where gains would be charged at more than one rate, you can use the tax-free allowance against the gains that would be charged at the highest rates.
Losses, and the four-year window people miss
A loss on a chargeable asset comes off the gains of the same tax year. That much is mechanical and you get no say in it, which is where the annoyance starts.
Current year losses are set against current year gains before the annual exempt amount is applied. HMRC's worked examples in CG21520 run in that order every time: deduct the total losses of the year from total gains, then deduct the annual exempt amount. If you have £4,000 of gains and £4,000 of losses in the same year, the losses wipe out the gains and the £3,000 exemption does nothing at all. It is not carried forward and it is not banked. It is simply gone for that year.
Losses brought forward from earlier years behave better. They come in after the annual exempt amount, so you use only as much of them as you need and the rest stays available. That asymmetry is worth knowing before you crystallise a loss in December.
The claim window is the part I see missed most. GOV.UK states that you do not have to report losses straight away and can claim up to 4 years after the end of the tax year in which you disposed of the asset. An unclaimed loss is not automatically available later. A loss from a disposal in 2022 to 2023 has to be claimed by 5 April 2027, and if it goes unclaimed it stops being usable regardless of how large it was.
The same page also rules out losses on disposals to a spouse, a civil partner or other connected people, unless you are offsetting a gain made on a disposal to the same person.
Bed and ISA, and bed and spouse
Both of these are things the rules permit rather than clever wheezes, and both work for reasons worth stating precisely, because the internet gets the reasoning wrong even when it gets the conclusion right.
Bed and ISA is selling a holding in a general account and buying it back inside an ISA. The sale is a real disposal and any gain on it is chargeable now. What changes is everything afterwards: GOV.UK lists ISAs and PEPs among the things you do not pay capital gains tax on, alongside UK government gilts and Premium Bonds, so future growth on the repurchased shares is outside the charge entirely. The cost of the exercise is one round trip of dealing costs, the spread, and the tax on the gain you just realised.
Two things to be straight about. It uses your ISA subscription allowance for the year, so it competes with new money rather than sitting alongside it. And the ISA is a one-way street on losses: regulation 22 of the Individual Savings Account Regulations 1998 provides that losses in respect of account investments are disregarded for the purposes of capital gains tax, so a holding that falls inside the wrapper gives you nothing to set against a gain outside it.
Bed and spouse works on the other requirement in section 106A. The 30-day rule only matches a disposal with securities acquired by the same person in the same capacity, so a purchase by your spouse is not caught by it. Transfers between spouses or civil partners who are living together are then treated under section 58 of TCGA 1992 as made for such consideration as gives neither a gain nor a loss to the transferor.
The condition underneath all of it is that a disposal has to be real. CG13350 says there is only a disposal where a person genuinely transfers beneficial ownership, and that there is no such transfer if there is an unconditional agreement to repurchase the asset at the time of sale. A sale with a guaranteed buy-back attached is not a sale.
If you are moving holdings between platforms at the same time as any of this, the mechanics of the move matter to the timing, and our guide on transferring a broker account covers what an in-specie transfer does and does not trigger.
What your broker's report actually gives you
A broker's annual statement is a record of what happened in that account. It is a good input and it is not an answer, and the difference costs people money in both directions.
Start with scope. The Section 104 pool is defined by share class and company, across everything you hold personally. Two brokers means two partial views of one pool, and neither of them is the pool. Shares transferred in from an old platform carry a cost the new platform may never have been told, and I have seen a transferred holding show up with an acquisition cost equal to its value on the transfer date, which would overstate a gain badly if anyone believed it.
Then ordering. A profit figure in an app is computed on some convention the platform chose, often average cost within that account and sometimes first-in-first-out. Neither convention knows about the same-day rule or the 30-day rule, and there is no reason for a trading app to model either.
Corporate actions are where I would look first for errors. Rights issues, bonus issues, share consolidations and returns of capital all change the pool, and platform handling of them is uneven.
What a broker does reliably give you is the transaction list: dates, share counts, prices and commissions. Export it as CSV every year, because the pool for a holding you have owned since 2018 depends on records from 2018, and platforms do not keep those available forever.
Foreign shares, accumulation units, and what is out of scope
A US or European holding is computed in sterling at both ends, and this catches people out. HMRC's position in CG78310 is that an amount of foreign currency must be converted into its sterling value at the time the amount is incurred or received, and it points to Bentley v Pike and Capcount Trading v Evans against the idea of computing the gain in the foreign currency and converting the result later.
The consequence is that sterling weakness alone can produce a taxable gain on a share whose dollar price never moved. Your pool is a sterling pool, built from the rate on each purchase date, and the disposal uses the rate on the sale date. The currency move between them sits inside the gain rather than beside it. Dividends on those holdings are a separate charge with their own withholding, which our W-8BEN guide deals with.
Accumulation units are the quiet overpayment. Income is retained and reinvested inside the fund instead of being paid out, but it is still your income and you are still taxed on it as it arises. HS284 then says you are allowed the amount of these distributions as additional expenditure on your accumulation units. Every notional distribution over the life of the holding raises your base cost. Ignore that and you pay tax twice on the same money, once as income and again as a gain, and on a fund held for a decade the numbers are not small. The figures are in the fund's annual tax voucher or consolidated tax certificate.
Some things are out of scope in a way that is worth stating so you do not go looking for them. Gains inside an ISA or a SIPP are not chargeable, and the GOV.UK list of what you do not pay it on also covers UK government gilts and Premium Bonds. If a holding never left a wrapper, it never enters any of the arithmetic on this page.
Reporting, and the threshold that is not about profit
There are two triggers, and the second one surprises people because it ignores whether you made any money.
The first is the obvious one: total taxable gains above the annual exempt amount. The second is proceeds. GOV.UK states that you need to report your gains in your tax return if the total amount you sold the assets for was more than £50,000, for the tax year 2023 to 2024 onwards. Sell £60,000 of shares at a £400 gain and you are inside that requirement.
For shares there are two routes. Self assessment is the usual one, reported in the tax year after the sale. The alternative is the real time capital gains tax service, which lets a UK resident report a gain and settle it earlier. Report by 31 December in the tax year after the gain and pay by the following 31 January, so a gain in 2026 to 2027 is reported by 31 December 2027 and paid by 31 January 2028. You attach a copy of your calculations when you report. It cannot be used for UK residential property, for foreign tax credit relief on overseas property, or for chargeable event gains on life insurance policies, and if you are already registered for self assessment you still put the sale on your return.
The 60-day clock that people half-remember is a residential property rule and has nothing to do with shares. It applies to UK residential property disposals made on or after 27 October 2021.
Whatever route you use, keep the workings. The pool balance you calculate this year is the opening figure for the next disposal, which might be six years away.
Frequently asked questions
What is the capital gains tax allowance for 2026 to 2027?
What rate do I pay on a gain from shares?
Which shares am I treated as having sold?
Does the 30-day rule stop me selling and buying back?
Do I need to file if my gain is under the allowance?
Are gains inside an ISA or a SIPP taxable?
Do commission and stamp duty come off the gain?
Related reading
Moving a holding between platforms without triggering a disposal is covered in our guide to transferring a broker account. The tax on income from US holdings, rather than on gains, is in our W-8BEN guide. How we check the figures on these pages is set out in our review methodology.
This page is general information and not tax advice. Rates, allowances and thresholds change, and the treatment of any particular disposal depends on your own circumstances. Check your position against HMRC or a qualified accountant before acting on anything here.
