Skip to content
InvestmentCalculator
All calculators

Capital gains tax on shares — methodology

What HMRC’s share identification rules do, why this calculator does not apply them, and how the gain you supply is then stacked on your income and taxed.

Open the capital gains tax on shares

This calculator taxes a gain you supply. For most disposals that is a reasonable division of labour; for shares it is the thing you have to read before anything else on the page, because a share sale is the disposal most likely to come out of a holding built up over several purchases — and the difference between “what I sold it for less what I paid for those shares” and the chargeable gain HMRC expects is exactly where a self-assessment goes wrong.

What share identification is, and why it is not here

For capital gains tax, shares of the same class in the same company are not individually identifiable. A sale is matched against acquisitions in a fixed statutory order:

  1. The same-day rule — shares acquired on the same day as the disposal.
  2. The 30-day rule — shares acquired in the 30 days after the disposal. This is the “bed and breakfasting” rule, and it is the reason selling to use up the annual exempt amount and buying straight back does not work.
  3. The s104 pool — everything else, held as one asset with one average cost.
pooled cost per share = total cost of the pool ÷ shares in the pool
allowable cost        = pooled cost per share × shares sold
gain                  = proceeds − allowable cost − dealing costs

None of that is done by this page. It taxes a gain you have already worked out, and a tool that quietly ignored the 30-day rule would not be a simplification of the tax — it would be a different and wrong answer. So the limitation is stated beside the input and again directly above the result, rather than only here.

This page used to say the rules were not implemented anywhere in this site’s engines, which was true when it was written and stopped being true on 13 August 2026. packages/tax-core now applies them — the bed and ISA calculator takes a list of purchases and a sale and shows which shares were matched under which rule, at what cost. This page still does not, because its input is a gain rather than a transaction history, and that is a fact about this page rather than about the software.

The calculation this page does perform, in order

  1. Start from the gain you entered.
  2. Deduct the annual exempt amount, once. What remains is the chargeable gain. The exempt amount does not consume basic-rate band, which is why the exempt slice of a gain never pushes the rest of it into the higher rate.
  3. Work out taxable income: income before tax less the personal allowance that actually applies to it. That allowance tapers above £100,000, so this step runs through the income tax engine rather than subtracting a fixed figure.
  4. Stack the chargeable gain on top of taxable income. The part landing below the basic-rate ceiling is charged at the basic rate for gains; the rest at the higher rate. One disposal routinely meets both.
  5. Gains qualifying for Business Asset Disposal Relief skip the stack entirely and are charged at a flat rate.
chargeable       = max(0, gain − annual exempt amount)
basic-rate room  = max(0, basic-rate ceiling − taxable income)
at basic rate    = min(chargeable, basic-rate room)
at higher rate   = chargeable − at basic rate

Rates and allowances

Read from the rules files this calculator runs on
Figure2025/262026/27
Annual exempt amount£3,000£3,000
Basic-rate band for gains (taxable income)£37,700£37,700
Shares and funds — basic / higher18.00% / 24.00%18.00% / 24.00%
Business Asset Disposal Relief14.00%18.00%
Relief lifetime limit (reported, not enforced)£1,000,000£1,000,000
Personal allowance£12,570£12,570

Capital gains tax is not devolved. The rates, the annual exempt amount and the basic-rate band for gains are the same across the UK; Scottish income tax bands differ but do not change which capital gains rate a gain meets. Residential property is charged at different rates and is not offered by this calculator — the general capital gains tax calculator covers it.

Sources

The rates, thresholds and allowances used by this calculator were verified against gov.uk on . That covers the published rates, thresholds and allowances this page calculates with. It does not verify any figure the page produces for you: that is arithmetic on verified inputs. Parts of the engine behind it are checked against HMRC’s own published worked examples, which tests the method on a small number of scenarios rather than your answer, and most of the test suite derives its expected values by hand. That check was carried out automatically and no named person has signed it off yet.

The verification log, as recorded in the source repository
Figures coveredVerified onVerified byHuman sign-off
2025-262026-08-12Automated verification (Claude Opus 5)not yet signed off
2026-272026-08-12Automated verification (Claude Opus 5)not yet signed off
2020-21 to 2024-25 — pension annual allowance only2026-08-12Automated verification (Claude Opus 5)not yet signed off
2025-26 and 2026-27 — share identification window only2026-08-13Automated verification (Claude Opus 5)not yet signed off
2025-26 and 2026-27 — pension relief at source only2026-08-13Automated verification (Claude Opus 5)not yet signed off
2025-26 and 2026-27 — inheritance tax only2026-08-13Automated verification (Claude Opus 5)not yet signed off
2025-26 and 2026-27 — family tax, LISA and pension-access additions2026-08-13Automated verification (Codex)not yet signed off
2025-26 and 2026-27 — student loan deductions only2026-08-18Automated verification (Claude Opus 5)not yet signed off
2025-26 and 2026-27 — property acquisition tax only2026-08-18Automated verification (Claude Opus 5)not yet signed off
2025-26 and 2026-27 — automatic enrolment only2026-08-18Automated verification (Claude Opus 5)not yet signed off
2025-26 and 2026-27 — State Pension age and rates only2026-08-18Automated verification (Claude Opus 5)not yet signed off

The log covers the rules directory, not only this calculator. 8 rows are deliberately narrow — 2020-21 to 2024-25 — pension annual allowance only; 2025-26 and 2026-27 — share identification window only; 2025-26 and 2026-27 — pension relief at source only; 2025-26 and 2026-27 — inheritance tax only; 2025-26 and 2026-27 — student loan deductions only; 2025-26 and 2026-27 — property acquisition tax only; 2025-26 and 2026-27 — automatic enrolment only; 2025-26 and 2026-27 — State Pension age and rates only — and they verify the figures named there and nothing else. Those tax years are not modelled by any calculator on this site: the years this page can compute are the ones its tax-year selector offers, and no others.

A verification goes stale the moment one of its sources is updated past the date above. If a source below carries a later date than this stamp, trust the source.

Rates, thresholds and allowances on this page are taken from material published by HM Revenue & Customs and the Scottish Government. Contains public sector information licensed under the Open Government Licence v3.0.

Three limits that change the answer, stated here rather than buried

  • The gain is yours to work out, and for shares that is where it usually goes wrong. This page taxes the figure you enter and does not derive it: there is no share matching, no same-day rule, no thirty-day rule and no s104 pooling. Enter a proceeds-less-what-you-paid figure where HMRC expects a pooled one and every number the calculator produces is arithmetic on the wrong input.
  • A full annual exempt amount is deducted on every run. The exemption is annual and this calculation is a single disposal, so a reader with other chargeable gains in the same tax year has already spent part or all of it and the figure shown is too low. Running the page once per disposal and adding the answers deducts the exemption once per run, which is the same error in a more convincing shape.
  • The Business Asset Disposal Relief lifetime limit is not applied. The relief is capped across every qualifying disposal you have ever made, and this calculator has no record of your earlier claims. If those claims have already used the cap, gains above it are charged at the ordinary rates and the figure shown is too low. Keep your own running total.

This site publishes information, not advice. It cannot know your circumstances, it does not recommend any product, provider or course of action, and nothing on it is a personal recommendation. For a decision that matters, check the figures against gov.uk or speak to an accountant or a regulated adviser.

Every calculation runs in your browser. There is no application server and no database, so nothing you type is transmitted or stored. A share link is the exception: it carries your figures in the URL.

Found an error? It belongs on the corrections log, and how to report one is on that page.