CGT Share Matching Calculator (Section 104 Pool)
Quick answer
Work out the Capital Gains Tax on shares or crypto with HMRC's matching rules applied automatically, the same-day rule, the 30-day "bed and breakfast" rule and the Section 104 pool.
Use the CGT Share Matching Calculator
Your transactions
Add every buy and sell of the same share or coin. We apply the same-day, 30-day and pool rules for you.
| Date | Type | Quantity | Price each (£) | Fees (£) | |
|---|---|---|---|---|---|
Tip: enter one asset at a time. Pooling is per-asset, so don't mix different shares or coins in the same table.
Total capital gain
- Net gain
- Annual exempt amount
- Taxable gain
- CGT due
Remaining Section 104 pool: units at cost .
How each sale was matched
| Sale date | Matched via | Quantity | Gain / loss |
|---|---|---|---|
Estimate only. Assumes all transactions are the same asset and standard rules apply (no gifts, bonus/rights issues, or non-UK complications). For large or unusual portfolios, get professional advice.
Source: GOV.UK official rates
What the CGT share matching calculator does
If you have sold shares, funds or crypto and you are not sure how much Capital Gains Tax you owe, this is exactly the sort of thing that keeps people up at night. The hard part is rarely the tax rate. It is working out which purchase your sale should be matched against, because HMRC does not simply let you say "I sold the shares I bought in 2019". This cgt share matching calculator applies the official HMRC matching rules for you, in the correct order, so you get a defensible gain or loss figure rather than a guess.
Speaking as someone who has untangled plenty of messy share and crypto disposals, the calculator removes the part everyone gets wrong: the matching. You enter your buys and sells, and it works through the same-day rule, the 30-day "bed and breakfasting" rule, and finally the Section 104 pool (the average cost pool). It then shows your total gain, deducts the annual exempt amount, and estimates the tax at the 2026/27 rates.
Who this affects
You need to think about share matching if you have disposed of any of the following outside a tax-free wrapper:
- Listed shares or shares in a private company
- Units in funds, unit trusts or OEICs
- Investment trusts and ETFs held in a general investment account
- Cryptoassets such as Bitcoin, Ethereum and most tokens
If your shares sit inside a stocks and shares ISA or a pension, you can relax: gains there are free of CGT, so the matching rules do not bite. If you are weighing up whether to use your allowance, the ISA calculator is worth a look first. For everything held outside those wrappers, the matching rules apply, and they apply per holding. That means each company's shares are pooled separately, and each crypto asset is pooled separately. Your Bitcoin and your Ethereum never mix.
The HMRC matching rules, in order
When you sell, HMRC matches the disposal to your acquisitions in a fixed sequence. The order matters, because each rule uses up shares before the next one gets a turn. Get the order wrong and your gain can be wildly off.
1. The same-day rule
Any shares of the same class in the same company that you buy on the same day you sell are matched first. So if you sell 500 BP shares and buy 200 BP shares on the same date, 200 of the sold shares are matched to that same-day purchase before anything else happens.
2. The 30-day rule (bed and breakfasting)
Next, any shares you buy in the 30 days following the disposal are matched to that sale. This is the anti-avoidance rule that stops people selling to crystallise a loss and immediately buying back the same holding. It catches a lot of well-meaning investors who rebalance or "tax-loss harvest" without realising the buy-back undoes the loss they were trying to bank.
3. The Section 104 pool
Anything left over is matched against the Section 104 pool. This is a single running pool of all your remaining shares in that holding, recorded at their average (pooled) cost. When you sell from the pool, you use the average cost per share rather than picking a specific lot. The same logic applies to crypto: each token has its own Section 104 pool.
For most ordinary investors who buy and hold, almost every disposal ends up matched against the Section 104 pool, and the average cost method is what really drives the answer. The capital gains tax calculator and the dedicated crypto tax calculator both lean on this same pooling logic.
2026/27 figures you need
Here are the headline numbers for the 2026/27 tax year. Always check your own position, because your CGT rate depends on your total taxable income, not just your gains.
| Item | 2026/27 figure |
|---|---|
| Annual exempt amount (individuals) | £3,000 |
| Annual exempt amount (most trusts) | £1,500 |
| CGT rate on shares and crypto, basic rate band | 18% |
| CGT rate on shares and crypto, higher and additional rate | 24% |
| Self Assessment filing deadline (online) | 31 January 2028 |
| Real Time CGT service alternative | By 31 December after the tax year |
The £3,000 annual exempt amount is the slice of total gains you can make each year before any CGT is due. It cannot be carried forward, so if you do not use it, you lose it. Your rate then depends on where your gains sit once stacked on top of your income: gains falling in your remaining basic rate band are taxed at 18%, and anything above is taxed at 24%. If you want to sanity-check which band you are in, run your earnings through the income tax calculator first, and our income tax rates and bands guide spells out the thresholds. The capital gains tax rates 2026/27 guide covers the detail too.
Worked example one: shares and the 30-day trap
Meet Priya. Over the years she built up a holding in a fund, all sitting in her Section 104 pool. On 10 May 2026 she owns 4,000 units with a pooled cost of £24,000, so an average cost of £6 per unit.
- On 10 May 2026 she sells 2,000 units for £18,000 (£9 each).
- She panics about the market, and on 28 May 2026 (within 30 days) she buys 1,200 units back for £10,800 (£9 each).
Because of the 30-day rule, 1,200 of the units she sold are matched not to her cheap pool but to the £10,800 buy-back. That portion has almost no gain: proceeds of £10,800 against cost of £10,800 gives a gain of nil on those units. The remaining 800 units are matched to the Section 104 pool at £6 each, so cost £4,800, proceeds £7,200, a gain of £2,400. Priya's total gain is £2,400, comfortably inside her £3,000 allowance, so no tax is due. But notice what happened: she expected to bank a chunky gain (or loss) and instead the buy-back reshaped the whole calculation. This is the single most common surprise I see.
Worked example two: crypto pooling per asset
Now meet Tom, a higher-rate taxpayer who dabbles in crypto. He only ever buys and sells Ethereum, so there is no same-day or 30-day match to worry about, just one Section 104 pool.
- March 2025: buys 5 ETH for £10,000 (£2,000 each).
- August 2025: buys 5 ETH for £20,000 (£4,000 each).
- His pool is now 10 ETH at a total cost of £30,000, an average of £3,000 each.
- June 2026: sells 4 ETH for £24,000 (£6,000 each).
The 4 ETH sold are matched to the pool at the average cost of £3,000 each, so cost £12,000 against proceeds £24,000. That is a gain of £12,000. After the £3,000 annual exempt amount, £9,000 is taxable. As a higher-rate taxpayer Tom pays 24%, which is £2,160. His pool now holds 6 ETH with a remaining cost of £18,000. Crucially, his Bitcoin (if he held any) would sit in a completely separate pool and play no part in this sum. Each cryptoasset is pooled on its own.
Tom must report this. Because crypto gains and most share gains are not covered by the property-only 60-day rule, he reports through Self Assessment or HMRC's real-time service. If you have also sold property, the CGT 60-day reporting calculator covers that separate regime.
Common mistakes people actually make
- Ignoring the order of the rules. People jump straight to average cost and forget the same-day and 30-day rules entirely. If you bought back within 30 days, you must apply that match first.
- Mixing assets in one pool. Crypto must be pooled per token and shares per company. Lumping them together gives a meaningless average.
- Forgetting crypto-to-crypto swaps are disposals. Swapping ETH for another token is a disposal of ETH at market value, even though no pounds changed hands.
- Missing allowable costs. Dealing fees, stamp duty on purchase and exchange fees usually reduce the gain. Keep the contract notes.
- Wasting the annual exempt amount. At only £3,000, the allowance is easy to exceed, and it cannot be rolled into next year.
- Assuming an ISA needs reporting. Gains inside an ISA or pension are tax-free and stay off your return entirely.
How to use this cgt share matching calculator
Using the tool is straightforward once your records are in front of you:
- Enter every purchase of the holding with its date, quantity and total cost including fees.
- Enter every sale with its date, quantity and proceeds.
- The calculator applies the same-day match, then the 30-day match, then draws the rest from the Section 104 pool.
- It shows the matched cost, the gain or loss on each disposal, your total gain, the £3,000 deduction and the estimated tax at 18% and 24%.
Treat the result as a strong, well-evidenced estimate to take into your return or to your accountant. If your situation involves enhancement costs, gifts, or part-disposals, those need a closer look, and the official HMRC helpsheet covers the edge cases in detail.
Record keeping that keeps you safe
HMRC can ask you to justify a disposal years later, and "I think I bought it around 2018" will not cut it. Keep contract notes, exchange CSV exports, wallet histories and bank statements showing the money in and out. If your records live in a PDF or a printout, the bank statement converter can turn them into something you can actually total up. Good records are what turn a stressful CGT calculation into a five-minute job, and they are your best defence if HMRC ever queries the figures.
Next steps
Run your buys and sells through the calculator, note your taxable gain after the £3,000 allowance, and check your rate band against your income. If you owe tax, you will usually report it on your Self Assessment return. Leaving it late is where penalties creep in, so use the tax deadline tracker to stay ahead of 31 January. You can read HMRC's own guidance on working out your gain, the rules for tax when you sell shares, and the detailed HS284 shares and Capital Gains Tax helpsheet.
A quick honest note: the figures above are for the 2026/27 tax year and are intended as general guidance, not personal advice. Tax rules change and individual circumstances vary, so please check your own position with HMRC or a qualified accountant before you file.
Reviewed by
Laura Michelle Davis - Chartered Tax Adviser (CTA)
ACCA · CTA (Chartered Tax Adviser) · ATT · BSc Economics, UC Berkeley
Laura Michelle Davis is a Chartered Tax Adviser (CTA) who also holds the ACCA and ATT qualifications and a BSc in Economics from UC Berkeley. She specialises in UK personal tax, covering income tax, National Insurance, self-employment and capital gains, and has built her career making complicated rules easy to follow. At TaxFly, Laura writes and edits the tax guides and explainers, checking that figures reflect current HMRC rates and that every explanation answers the question a real person is actually asking. Her goal is plain-English clarity you can trust and act on.
Embed this calculator for free
Add the CGT Share Matching Calculator to your own website. It shows just the tool, resizes automatically, and includes a small credit link back to TaxFly. Copy and paste:
Frequently asked questions
Related guides
HMRC Wage Raid Payroll Checks 2026: Who Gets Visited and Why
Payroll compliance checks have stepped up sharply in 2026, with 389 employers named and the new Fair Work Agency investigating without complaints. Who is at risk, and the self-audit that prevents it.
Read guide GuideTax Code 1257L: What It Means and Why You Have It (2026/27)
1257L is the standard UK tax code for 2026/27, giving the full £12,570 Personal Allowance. Here is what it means, when it is wrong and what a wrong code costs.
Read guide GuideHMRC Is Fining Lifetime ISA Savers: The 25% Withdrawal Trap
More than 129,000 savers paid LISA withdrawal charges in a single year, averaging £790. Why the 25% charge takes your own money too, who it hits, and what to do instead.
Read guide GuideWhat Is a P45? Every Part Explained and What to Do With It
Your P45 carries your tax position from one job to the next. What each of the four parts does, what to do if you lose it and the emergency tax it prevents.
Read guide