To calculate CGT on shares, take what you sold the shares for, deduct what they cost you (including dealing costs), and apply HMRC’s share matching rules: shares bought the same day come first, then shares bought in the next 30 days, then your section 104 pool at average cost. Add up the gains for the tax year, deduct losses and the £3,000 annual exempt amount, and tax the rest at 18% or 24% for 2026/27.
The matching rules are where most DIY calculations go wrong, especially if you buy the same shares several times or buy back soon after selling. This guide explains each step with a full worked example using 2026/27 figures.
When You Pay CGT on Shares
You may pay Capital Gains Tax when you sell, give away or otherwise dispose of shares that have risen in value. This includes shares in listed companies, unit trusts and OEICs held outside a tax wrapper, and shares in private companies.
Some holdings are exempt, including:
- Shares held in an ISA or a pension (see ISAs and pensions as CGT wrappers)
- UK government gilts and qualifying corporate bonds
- Shares in an employer Share Incentive Plan (SIP), if kept in the plan
- Gifts of shares to your spouse, civil partner or a charity
Gifts to anyone else, such as your children, are treated as a sale at market value, so a gain can arise even though you receive nothing.
Step 1: Work Out Your Proceeds and Costs
Your proceeds are the amount you received for the shares, less any broker commission on the sale. For gifts or transfers to connected people, use the market value on the date of disposal.
Your allowable cost is what you paid for the shares plus incidental costs of buying them, such as broker commission and the 0.5% stamp duty (or SDRT) on UK shares. If you inherited the shares, your cost is their probate value; our guide to inheriting shares and CGT explains this.
If you bought or sold in a foreign currency, convert each figure to sterling at the exchange rate on the date of that transaction.
Step 2: Apply the Share Matching Rules
When you have bought the same class of shares in the same company more than once, you cannot simply choose which shares you sold. HMRC requires disposals to be matched in this order:
- Same-day rule: shares bought on the same day as the sale
- 30-day rule: shares bought in the 30 days after the sale (the “bed and breakfast” rule)
- Section 104 pool: all other shares, held at their average cost
How the Section 104 Pool Works
The section 104 pool combines all your shares in one company (other than those matched under the first two rules) into a single holding with one total cost. Each purchase adds shares and cost to the pool. When you sell from the pool, you take out a proportion of the cost equal to the proportion of shares sold.
Shares acquired through dividend reinvestment plans are new purchases and are added to the pool at their cost, so keep a record of each one.
Why the 30-Day Rule Matters
The 30-day rule stops investors selling shares to use their annual exempt amount or a loss and buying them straight back. If you repurchase within 30 days, the gain or loss is calculated against the new purchase price instead. Repurchases inside an ISA (“Bed and ISA”) or by your spouse are not caught by the rule.
Worked Example: CGT on Shares in 2026/27
This is an illustrative example, not a real client. Sarah is a higher rate taxpayer who holds shares in ABC plc outside an ISA.
| Date | Transaction | Shares | Cost |
|---|---|---|---|
| May 2015 | Bought 2,000 shares (£4,000 + £20 commission) | 2,000 | £4,020 |
| March 2019 | Bought 1,000 shares (£3,500 + £15 commission) | 1,000 | £3,515 |
| Section 104 pool | 3,000 | £7,535 | |
| 10 June 2026 | Sold 1,500 shares for £9,000 less £15 commission | (1,500) | Proceeds £8,985 |
| 25 June 2026 | Bought back 500 shares for £2,900 including costs | 500 | £2,900 |
1. Match 500 shares under the 30-day rule. The repurchase on 25 June is within 30 days, so 500 of the shares sold are matched with it. Proceeds are £8,985 × 500/1,500 = £2,995. Cost is £2,900. Gain: £95.
2. Match the other 1,000 shares with the section 104 pool. Proceeds are £8,985 × 1,000/1,500 = £5,990. Cost is £7,535 × 1,000/3,000 = £2,512. Gain: £3,478.
3. Total the gain and apply the allowance.
| Calculation | Amount |
|---|---|
| Total gain (£95 + £3,478) | £3,573 |
| Less annual exempt amount 2026/27 | (£3,000) |
| Taxable gain | £573 |
| CGT at 24% (higher rate taxpayer) | £137.52 |
| CGT at 18% (if within the basic rate band) | £103.14 |
After the sale, Sarah’s pool holds 2,000 shares with a cost of £5,023 (£7,535 − £2,512). The 500 shares bought on 25 June have already been matched, so they do not join the pool. You can check your own figures with our shares CGT calculator.
CGT Rates and Allowances for 2026/27
| Item | 2026/27 |
|---|---|
| Annual exempt amount | £3,000 |
| CGT rate within the basic rate band | 18% |
| CGT rate above the basic rate band | 24% |
| Business Asset Disposal Relief rate (qualifying shareholdings) | 18% |
Directors and employees selling shares in their own trading company may qualify for Business Asset Disposal Relief; see directors selling shares and CGT and employee share schemes and CGT for the conditions.
How to Reduce CGT on Shares
- Use your £3,000 annual exempt amount each tax year by spreading sales over two tax years where it makes sense
- Offset capital losses on other investments; see offsetting investment losses against gains
- Transfer shares to a spouse or civil partner at no gain, no loss so both allowances and basic rate bands can be used
- Move investments into an ISA each year using “Bed and ISA”
- Consider the timing of sales against your income, as gains within the basic rate band are taxed at 18%
For a wider view, read our capital gains tax planning guide and the latest position on the CGT annual allowance for 2026.
Reporting and Paying CGT on Shares
You must report the sale if your total gains for the year, after losses, are more than £3,000. If you are registered for Self Assessment, you must also report if your total proceeds from disposals were more than £50,000, even if no tax is due.
- Real Time CGT service: if you do not normally file a tax return, report by 31 December 2027 for 2026/27 sales and pay by 31 January 2028
- Self Assessment: report on the capital gains pages (SA108) by 31 January 2028, and pay by the same date
Keep contract notes, dividend reinvestment records and corporate action notices for every holding, because you will need them to rebuild the section 104 pool.
Frequently Asked Questions
Do I pay CGT on shares if my gain is under £3,000?
No tax is due if your total gains for 2026/27, after losses, are within the £3,000 annual exempt amount. You may still need to report the sale on a Self Assessment return if your total sale proceeds were more than £50,000.
What is the 30-day rule for shares?
If you sell shares and buy the same class of shares in the same company within the next 30 days, the sale is matched with the new purchase instead of your section 104 pool. This stops “bed and breakfasting” to crystallise a gain or loss.
Can I deduct dealing costs when calculating CGT on shares?
Yes. Broker commission and stamp duty paid on purchase are added to your cost, and commission on the sale is deducted from your proceeds. Platform fees and advice fees are not usually allowable.
What rate of CGT do I pay on shares in 2026/27?
18% on gains that fall within your unused basic rate band and 24% on gains above it, after deducting the £3,000 annual exempt amount.
Are shares in an ISA subject to CGT?
No. Gains on shares held in an ISA are exempt and do not need to be reported. Shares in a pension are also outside CGT.
Get Help With CGT on Shares
Share matching becomes complex quickly with regular investing, dividend reinvestment, takeovers or foreign shares. Our shares and investments CGT service rebuilds your section 104 pools, applies the matching rules and files your return or real time report. Call +44 (0)1204 859315 or send an enquiry for a free initial consultation and a fixed-fee quote within 24 hours.
Official guidance: work out your gain on shares, selling shares in the same company, HS284 Shares and Capital Gains Tax and CGT allowances (GOV.UK).