CGT Guides

How to Calculate UK Capital Gains Tax on Shares — The Complete 2025/26 Guide

23 March 2026 · 7 min read · By admin

If you’ve sold shares this year and made a profit, you probably owe HMRC some Capital Gains Tax. The trouble is, working out exactly how much isn’t straightforward — not because the maths is hard, but because HMRC has a specific set of rules about which shares you’re treated as having sold.

This guide walks through everything from scratch. No jargon without explanation, no assumptions about what you already know. By the end, you’ll understand exactly how UK CGT works on shares, how to calculate it yourself, and how to report it on your self-assessment.

The basics: what gets taxed and what doesn’t

Capital Gains Tax applies when you dispose of an asset — selling it, giving it away, or swapping it for something else. For shares, the most common trigger is simply selling them for more than you paid.

A few things to note upfront:

You’re taxed on the gain, not the total sale price. If you bought shares for £5,000 and sold them for £8,000, the gain is £3,000 — that’s the bit HMRC is interested in.

Shares held inside an ISA or SIPP are completely exempt. No CGT, no reporting, nothing. If you’re not using your £20,000 ISA allowance, that’s the single best thing you can do to reduce your tax bill.

Transfers to your spouse or civil partner happen at “no gain, no loss” — effectively tax-free. They inherit your original cost basis.

You get a tax-free allowance each year. For 2025/26, it’s £3,000. Gains below that threshold aren’t taxed. This used to be £12,300 back in 2022/23, so it’s been slashed significantly.

Tax Year Annual Exempt Amount Basic Rate Higher Rate
2022/23 £12,300 10% 20%
2023/24 £6,000 10% 20%
2024/25 (before 30 Oct) £3,000 10% 20%
2024/25 (from 30 Oct) £3,000 18% 24%
2025/26 £3,000 18% 24%

The October 2024 rate change catches some people off guard. If you sold shares both before and after 30 October 2024 in the same tax year, different rates apply to different sales. We’ll cover how to handle that later.

HMRC’s share matching rules — the part most people get wrong

Here’s where it gets properly interesting. Unlike in the US (where you can choose which specific shares you sold), the UK has mandatory matching rules. HMRC tells you which shares you’re treated as having disposed of, in a specific order.

The rules exist to prevent a trick called “bed and breakfasting” — where you’d sell shares to crystallise a loss, then immediately buy them back. Parliament closed that loophole in 1998, and the current rules have been in place since April 2008.

When you sell shares, HMRC matches them in this order:

Rule 1: Same-day acquisitions. If you bought shares in the same company on the same day you sold them, those purchases are matched first. In practice, this matters most for active traders and employee share scheme participants who exercise and sell on the same day.

Rule 2: The 30-day rule (bed and breakfast). Next, shares are matched against any you bought in the 30 days after the sale. Note — it’s 30 days after, not before. This stops you selling and rebuying to create an artificial loss.

Rule 3: The Section 104 pool. Everything else goes into a pool. All your remaining shares of the same type in the same company are lumped together, and the cost is averaged. This is the most common matching method for ordinary buy-and-hold investors.

The Section 104 pool — how it actually works

The pool is simpler than it sounds. Think of it as a running total: every time you buy shares, the pool gets bigger (more shares, more cost). Every time you sell, it gets smaller (fewer shares, proportionally less cost).

Let’s work through a real example.

Sarah’s trades in Acme plc:

Date Action Shares Price Total Cost
15 Mar 2023 Buy 500 £4.00 £2,000
10 Sep 2023 Buy 300 £5.50 £1,650
22 Jan 2025 Sell 400 £7.20

Step 1: Before the sale, Sarah’s pool looks like this: 800 shares, total cost £3,650, average cost £4.5625 per share.

Step 2: She didn’t buy any Acme shares on 22 January (same-day rule doesn’t apply) or in the 30 days after (30-day rule doesn’t apply). So the sale matches against the pool.

Step 3: The allowable cost for 400 shares from the pool is: 400 × £4.5625 = £1,825.00

Step 4: Gain = proceeds − cost = (400 × £7.20) − £1,825.00 = £2,880 − £1,825 = £1,055 gain

Step 5: After the sale, the pool has 400 shares remaining with a cost of £1,825 (£3,650 − £1,825).

That’s it. The pool doesn’t care when individual shares were bought — it’s all averaged together.

The 30-day rule in action — a worked example

This one trips up more people than any other rule. Let’s say Sarah sells 200 Acme shares on 5 March 2025 at £8.00 each, then buys 200 back on 25 March 2025 at £7.50 each.

Because the repurchase is within 30 days of the sale, the 30-day rule kicks in. The sale is matched with the new purchase at £7.50, not the pool average of £4.5625.

Item Amount
Proceeds (200 × £8.00) £1,600.00
Cost (matched to 25 Mar buy: 200 × £7.50) £1,500.00
Gain £100.00

Without the 30-day rule, the gain would have been £1,600 − (200 × £4.5625) = £687.50. The rule dramatically changes the result. And crucially, those 200 repurchased shares do not enter the Section 104 pool — they’ve been matched directly to the sale.

The key takeaway: if you sell shares and want to buy them back, wait at least 31 days. Or buy them inside an ISA instead — that’s perfectly fine and avoids the rule entirely.

Including fees in your calculation

HMRC allows you to deduct “incidental costs of acquisition and disposal” from your gain. In plain English, that means:

When you buy: broker commission, stamp duty (0.5% on UK shares), and FX conversion fees all get added to your cost.

When you sell: broker commission and FX fees get deducted from your proceeds.

If Sarah paid £11.95 commission on each trade, her adjusted gain on the 400-share sale would be:

Proceeds: £2,880.00 − £11.95 = £2,868.05
Cost: £1,825.00 + proportional share of buy commissions
Gain: slightly less than £1,055

Every penny counts when you’re near the £3,000 allowance boundary.

Foreign currency shares — getting the exchange rate right

If you trade US stocks on platforms like Robinhood UK, Trading 212, or Tastytrade, all your gains need converting to GBP. HMRC publishes official monthly exchange rates on the Trade Tariff service.

The rates are in “foreign currency per £1” format — so to convert $1,500 USD at a rate of 1.27, you’d calculate: £1,500 ÷ 1.27 = £1,181.10.

Use the rate for the month of each transaction. The buy gets converted at the buy month’s rate; the sell gets converted at the sell month’s rate. This means you can have a gain in USD but a loss in GBP (or vice versa) if the exchange rate moved significantly.

Calculating your tax bill

Once you’ve worked out your total gains and losses across all disposals:

1. Add up all your gains for the year.

2. Subtract any allowable losses from the same year.

3. If you have unused losses from previous years, subtract those next (but only enough to bring the gain down to the annual exempt amount — you can’t waste brought-forward losses).

4. Subtract the annual exempt amount (£3,000 for 2025/26).

5. The remainder is your taxable gain. Apply the appropriate rate.

The rate depends on your income tax band. Add your taxable gain to your other income for the year. Anything falling within the basic rate band (up to £37,700 above your personal allowance) is taxed at 18%. Anything above that is at 24%.

Example: James earns £45,000 salary. After his £12,570 personal allowance, his taxable income is £32,430. He has £5,270 of basic rate band remaining (£37,700 − £32,430). His taxable capital gain after the exemption is £4,000.

£4,000 fits entirely within his remaining basic rate band, so he pays 18% = £720.

If his gain were £8,000 instead: £5,270 at 18% = £948.60, plus £2,730 at 24% = £655.20. Total: £1,603.80.

Reporting on your self-assessment (SA108)

Capital gains from shares go on the SA108 supplementary page of your self-assessment tax return. The key boxes are:

Box What goes here
Box 23 Number of disposals (how many sales you made)
Box 24 Total disposal proceeds (what you received)
Box 25 Total allowable costs (what it cost you, including fees)
Box 26 Gains in the year, before losses
Box 27 Losses in the year

These are for “listed shares and securities” — meaning anything traded on a recognised stock exchange. Options and other derivatives go in Boxes 14-22 on a different section of the same form.

You must report if your total disposal proceeds exceed £12,000 (4× the annual exemption) OR your gains exceed £3,000, even if no tax is due after the exemption.

Common mistakes to avoid

Using FIFO instead of pooling. If you’re used to US tax rules, you might instinctively match your oldest shares first. That’s wrong for UK CGT. HMRC uses average-cost pooling, not first-in-first-out.

Forgetting the 30-day rule. Sold shares and rebought within a month? The cost basis changes. Lots of people miss this, especially with regular investment plans.

Ignoring fees. Every commission, every stamp duty payment, every FX fee — they all reduce your taxable gain. Keep records.

Not converting foreign trades to GBP. Each transaction should be converted at the HMRC rate for that month. Don’t use the annual average or the rate on a random currency converter.

Mixing ISA and GIA trades. ISA trades are exempt. Make sure you’re not including them in your calculation.

Doing this by hand vs using a calculator

If you have a handful of trades in one company, the maths is manageable. But if you trade regularly across multiple stocks, with different brokers, in foreign currencies — it gets genuinely tedious. The matching rules, the pool tracking, the FX conversion, the fee allocation — doing it all in a spreadsheet is a recipe for errors.

That’s exactly why we built TaxBull. Upload your broker CSV, and it applies all the HMRC rules automatically — same-day compositing, 30-day bed and breakfast matching, Section 104 pooling, fee allocation, FX conversion using official HMRC rates, and SA108 box mapping. It supports Robinhood UK, Trading 212, Freetrade, Tastytrade, and any broker via generic CSV.

This guide is for informational purposes only and does not constitute tax advice. Always verify your calculations with a qualified chartered accountant or tax professional before filing your self-assessment.

Tags:2025/26capital gains taxHMRCSA108section 104share matchingshares
Ready to calculate your UK Capital Gains Tax?

Free HMRC-compliant calculator with SA108 output. Supports Robinhood UK, Trading 212, Freetrade, and more.

Calculate CGT Free →

Leave a Reply

Your email address will not be published. Required fields are marked *