Capital gains tax on shares
The £3,000 allowance, the 18% and 24% rates, and the share-matching rules that decide what your shares actually cost, in plain English.
Capital gains tax on shares is the tax on the profit when you sell shares held outside an ISA or pension for more than you paid. The first £3,000 of gains each year is tax-free; above that you pay 18% or 24% in 2026/27. The tricky part is not the rate, it is working out what you actually paid for the shares you sold, which uses HMRC’s share-matching rules. That is what this article walks through.
The short version
- Shares in a stocks and shares ISA or pension are free of CGT. The tax only applies to shares in an ordinary dealing account.
- To work out the cost of shares you sold, you match them in order: same-day buys first, then buys in the next 30 days, then your pooled holding.
- The pool, the Section 104 holding, gives every share you own a single average cost. Most ordinary sales just use this.
- After the £3,000 exemption, the gain is taxed at 18% or 24%, and you report it through Self Assessment. An estimate to plan with, not advice.
| The shares you sold are matched to… | Order | What it covers |
|---|---|---|
| Shares bought on the same day | 1st | Anything bought the same day you sold |
| Shares bought in the next 30 days | 2nd | Buy-backs within 30 days of the sale |
| The Section 104 pool | 3rd | Everything else, at the average cost per share |
Do you pay capital gains tax on shares?
Only on shares held outside a tax wrapper. Shares and funds inside a stocks and shares ISA or a pension are free of capital gains tax, however much they grow, so the tax bites on holdings in an ordinary dealing or share-trading account. You pay it on the gain, the profit, not on the whole amount the sale raised. Selling £20,000 of shares that cost you £15,000 is a £5,000 gain, and it is the £5,000 that matters.
A few share moves are not a taxable disposal at all. Giving shares to your spouse or civil partner does not trigger CGT (they take on your cost). Inheriting shares does not either: your cost becomes their value on the date of death, and you only pay CGT later on the rise from there. This article is the share-specific companion to how capital gains tax works overall, so for the allowance, the bands and how gains stack on your income in general, start there.
How much capital gains tax you pay on shares
After the £3,000 annual exempt amount, the rate is 18% on the part of the gain that falls within your remaining basic-rate band, and 24% on anything above it. There is no lower rate for shares: since 30 October 2024 they are taxed at the same rates as residential property and other assets. Gains are the top slice of your income, so your salary and other income fill the bands first and the gain stacks on top, which is what decides whether a slice is taxed at 18% or 24%.
- 0% on the first £3,000 of total gains in the tax year.
- 18% on the gain that sits within the basic-rate band (which runs to £37,700 of taxable income).
- 24% on the gain above the basic-rate band.
The capital gains tax calculator splits a gain across the bands for you once you know the gain itself. Working out the gain on shares is the hard bit, and the next two sections are where share-specific rules come in.
The share-matching rules (working out the cost)
Here is the problem. You bought the same share several times, at different prices, then sold some of them. Which ones did you sell? You cannot just pick the cheapest or the dearest. HMRC sets the order for you, and you apply it in this sequence:
- The same-day rule. First, match the shares you sold against any of the same shares you bought on the same day. Day-trading the same stock is netted off before anything else.
- The 30-day rule (bed and breakfasting). Next, match against any of the same shares you bought in the 30 days after the sale. So if you sell on the 1st and buy the same shares back on the 20th, that sale is matched to the buy-back, not to your older holding.
- The Section 104 pool. Whatever is left is matched against your pooled holding, at its average cost per share. For most ordinary sales, where you are not trading in and out, this is the only rule that applies.
The 30-day rule exists to stop a trick once called “bed and breakfasting”: selling shares to bank a loss or use up your £3,000 exemption, then buying the very same shares straight back so you never really left the market. Because the sale gets matched to the repurchase, the gain or loss is tiny and the move achieves nothing. Buying the shares back inside an ISA or a pension instead, or your spouse buying them, is not caught by the rule, which is why “bed and ISA” is the route people use.
The Section 104 holding: your average cost
The Section 104 holding, usually just called “the pool”, is a single running total of all your shares of the same type in the same company. Every purchase adds its shares and its cost to the pool; the cost per share is simply the total pool cost divided by the total number of shares in it. When you sell, you take out shares at that average cost.
Say you buy 100 shares for £80, then later 300 more for £360. The pool now holds 400 shares costing £440, so the average cost is £1.10 a share. Sell 150 of them and the cost you deduct is 150 × £1.10 = £165; the remaining 250 shares stay in the pool at £275. Every time you buy, the average shifts; every time you sell, you take shares out at the current average. (Special rules apply to shares you held back on 31 March 1982, where you use the value on that date instead, so check HMRC’s helpsheet if that is you.)
A worked example: a part-disposal from the pool
Suppose you bought shares in the same company twice and then sold some of them, with no same-day or 30-day buy-backs to worry about, so the whole sale comes out of the pool.
- March 2021: bought 1,000 shares for £4,000 (£4.00 each).
- June 2023: bought 1,000 shares for £6,000 (£6.00 each).
- The pool: 2,000 shares costing £10,000, so an average cost of £5.00 a share.
In 2026/27 you sell 1,200 of them for £9,600 (£8.00 each), paying £30 in dealing fees. The cost coming out of the pool is 1,200 × £5.00 = £6,000. So:
- Proceeds £9,600, less £30 fees, less £6,000 cost = a gain of £3,570.
- Take off the £3,000 annual exemption (assuming none is used elsewhere) and the taxable gain is £570.
- If that £570 sits within your basic-rate band, the tax is 18%, which is £102.60. The 800 shares left stay in the pool at £4,000.
Run your own gain through the capital gains tax calculator and it handles the band split; the pool maths above is the part you do first, by hand or from your broker’s statements.
How to pay less capital gains tax on shares, legitimately
You cannot dodge tax on a real gain in a dealing account, but several legitimate moves cut the bill. They depend on your circumstances, so treat them as a checklist to discuss with an accountant, not a rule of thumb.
- Use ISAs and pensions. Gains on shares and funds inside a stocks and shares ISA or a pension are free of CGT. This is the big one.
- “Bed and ISA”. Sell holdings in your dealing account and rebuy them inside your ISA, moving future growth into the tax-free wrapper. The sale itself is a disposal, so it can use your £3,000 exemption, and because the rebuy is in an ISA the 30-day rule does not bite.
- Use your £3,000 exemption every year. It is per person, per year, and cannot be carried forward, so an unused part is lost.
- Transfer to a spouse or civil partner. Gifts between spouses are CGT-free, so moving some shares across lets a couple use two exemptions and two sets of bands.
- Offset losses. Losses on other shares in the same year, or carried forward from earlier years if you reported them, reduce your gains.
- Spread a sale across two tax years. Selling in two instalments either side of 6 April uses two years’ exemptions.
Reporting share gains and keeping records
Share gains do not use the 60-day route that applies to UK residential property. You report them through Self Assessment, on the capital gains summary pages of your tax return after the tax year ends, and pay by the usual 31 January deadline. You generally need to report if the gains are above the £3,000 exemption, or if the total you sold for in the year was more than £50,000, even when the gain is covered by the allowance.
Keep the records that back up the pool: the contract notes for every buy and sell, the dates, the number of shares, the prices and the dealing fees. Your broker’s annual statement usually has these, but the pool is yours to track across all your accounts in that company. If you are a company director weighing how to take money out, it is worth seeing how dividend tax compares, since dividends and share gains are taxed in quite different ways.
Common questions
- How much capital gains tax to pay on shares?
- Nothing on the first £3,000 of total gains in 2026/27. Above that, you pay 18% on the part of the gain that falls within your remaining basic-rate band and 24% on anything above it. Shares held in a stocks and shares ISA or a pension are free of CGT entirely.
- How much tax do I pay if I sell my shares?
- It depends on the gain, not the sale price. Work out the gain (sale proceeds minus the cost of those shares, minus dealing fees), take off any unused part of your £3,000 annual exemption, then apply 18% or 24% depending on where the gain sits on top of your income. Selling shares inside an ISA or pension is tax-free.
- How do I avoid capital gains tax on shares?
- You cannot avoid tax on a genuine gain outside a tax wrapper, but you can reduce it. Hold shares in a stocks and shares ISA or pension, where gains are CGT-free; move existing holdings in with "bed and ISA"; use your £3,000 exemption each year; transfer shares to a spouse to use theirs; and offset losses on other holdings.
- How much is capital gain tax on shares?
- The rates are 18% within the basic-rate band and 24% above it for 2026/27, after the £3,000 tax-free allowance. These are the same rates that apply to other assets and to residential property. There is no separate, lower rate for shares.
- How do you work out the cost of shares bought at different times?
- You match the shares you sold against your purchases in a set order: first any bought on the same day, then any bought in the 30 days after the sale, then the rest against your "Section 104 pool", which holds all your earlier holdings at a single average cost per share. The pool is what most ordinary sales use.
- What is the 30-day rule on shares?
- If you sell shares and buy back the same shares in the same company within the next 30 days, the sale is matched to that repurchase rather than to your pooled holding. It blocks "bed and breakfasting", selling to bank a loss or use your allowance, then buying straight back. Buying back inside an ISA instead is not caught.
- Do I pay capital gains tax on inherited shares?
- You do not pay CGT when you inherit shares. Your cost for CGT becomes their market value at the date of death. You only pay CGT later, on the gain from that value to the price you sell them for. Inheritance tax is a separate matter handled by the estate.
- Are these capital gains figures exact?
- They are an estimate to help you plan, not financial or tax advice. The £3,000 exemption, the 18% and 24% rates and the matching rules are correct for 2026/27, but your actual bill depends on your income, your costs and any losses. Confirm your position with HMRC or a qualified accountant.
About this article
Written by the calcd team. We build UK money calculators and explain the numbers behind them in plain English. We checked the share-matching rules (the same-day rule, the 30-day rule and the Section 104 pool) against HMRC’s helpsheet HS284 “Shares and Capital Gains Tax” and the gov.uk “Tax when you sell shares” guidance, and the £3,000 annual exempt amount and the 18% and 24% rates against gov.uk capital gains tax guidance for the 2026/27 tax year. The figures and examples here are an estimate to help you plan, not financial or tax advice. Your actual bill depends on your income, your costs and any losses, so confirm it with HMRC or a qualified accountant. Last updated June 2026.