Skip to main content

CGT Share Matching Calculator (Section 104 Pool)

Last reviewed 3 July 2026 by TaxFly Editorial Team
Share

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.

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.

Could not save, please try again. Free account needed, log in or sign up to save your results.

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.

Item2026/27 figure
Annual exempt amount (individuals)£3,000
Annual exempt amount (most trusts)£1,500
CGT rate on shares and crypto, basic rate band18%
CGT rate on shares and crypto, higher and additional rate24%
Self Assessment filing deadline (online)31 January 2028
Real Time CGT service alternativeBy 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.

Who should use this tool

You cannot simply take the price you paid for shares and subtract it from the sale price. HMRC applies matching rules in a fixed order: shares sold are matched first against any bought on the same day, then against any bought in the following 30 days, and only then against the pooled average cost of everything else held.

The 30-day rule exists to stop “bed and breakfasting” — selling to crystallise a loss and buying straight back. Sell and repurchase within 30 days and the matching rules cancel the effect. This works through a full transaction history and applies the rules in order.

What this tool assumes

  • Disposals are matched in order: same day, then the next 30 days, then the Section 104 pool of everything else.
  • The pool holds a running average cost across all remaining shares of the same class.
  • Purchase costs and dealing charges form part of the allowable cost.
  • Every buy and sell of the holding must be entered for the result to be right.

Limitations — what it does not cover

  • Bed and spouse or bed and ISA, legitimate alternatives that avoid the 30-day rule — repurchasing in a spouse’s name or inside an ISA.
  • Corporate actions — rights issues, bonus issues, takeovers, demergers — which change the pool in specific ways.
  • Accumulation units, where reinvested income increases the base cost and is routinely missed.
  • Different share classes, which are pooled separately.
  • Employee share schemes, with their own acquisition-cost rules.
  • Currency effects on overseas holdings.

Frequently asked questions

What is the 30-day bed and breakfast rule?
It is an HMRC matching rule that takes priority over your Section 104 pool. If you sell shares or crypto and buy back the same holding within the following 30 days, the disposal is matched to that repurchase rather than to your average-cost pool. The point is to stop people selling purely to bank a loss and then buying straight back in. In practice it often wipes out the gain or loss someone was expecting, so always check whether you repurchased within 30 days before calculating anything.
How does the Section 104 pool work?
The Section 104 pool is a single running record of all your remaining shares in one company, or all your remaining units of one cryptoasset, held at their combined average cost. When you sell from the pool, you use the average cost per unit rather than picking a specific purchase. Each new buy adds to the pool and recalculates the average. It is the final rule applied, after the same-day and 30-day matches, and for most buy-and-hold investors it is the rule that actually decides the gain.
Are crypto gains pooled in the same way as shares?
Yes. HMRC treats most cryptoassets as chargeable assets, and the same matching rules apply: same-day, then 30-day, then a Section 104 pool. The key difference is that each token is pooled separately. Your Bitcoin sits in one pool and your Ethereum in another, and they never blend. Remember that swapping one crypto for another counts as a disposal at market value, even when no cash changes hands, so it can trigger a gain.
How much is the Capital Gains Tax allowance for 2026/27?
For 2026/27 the annual exempt amount is £3,000 for individuals and £1,500 for most trustees. You can make gains up to that amount across all your disposals in the tax year before any CGT is due. It cannot be carried forward, so an unused allowance is simply lost at the end of the year. Above the allowance, gains on shares and crypto are taxed at 18% within your basic rate band and 24% above it.
What CGT rate will I pay on shares and crypto?
For 2026/27 the rates on shares and crypto are 18% and 24%. Which one applies depends on your total taxable income. Your gains are stacked on top of your income: any part of the gain that falls within your remaining basic rate band is taxed at 18%, and anything above it is taxed at 24%. A higher or additional rate taxpayer will usually pay 24% on the whole gain. Checking your income band first is the only reliable way to know.
Do I need to report share or crypto gains to HMRC?
You generally need to report if your total gains exceed the £3,000 annual exempt amount, or in some cases if your total proceeds are large even when the gain is small. Most people report share and crypto gains through their Self Assessment tax return, with the online deadline of 31 January after the tax year. HMRC also offers a real-time service to report and pay sooner. Gains inside an ISA or pension are tax-free and do not need reporting at all.

Use this calculator on your site

Free to embed, no attribution fee — just keep the credit line. It stays up to date automatically, because it loads from us.

Preview

Guides that explain this

All guides →

Software that files it for you

Partner links

If you keep your own books, these are the packages that handle Self Assessment and Making Tax Digital.

FreeAgent

4.8
Free optionMTD ready

The freelancer and contractor favourite, free with some bank accounts.

  • Free forever with a NatWest, Royal Bank of Scotland, Ulster or Mettle business account
  • Built-in Self Assessment and MTD for Income Tax filing

From £0 with a NatWest, RBS or Mettle account, otherwise about £19/mo

See FreeAgent

QuickBooks

4.6
MTD ready

The big all-rounder with the deepest MTD track record.

  • Sole Trader plan built specifically for Self Assessment and MTD
  • Snap and store receipts, automatic bank feeds

From about £10/mo, frequent 90% off intro offers

See QuickBooks

Xero

4.5
MTD ready

The scale-up choice once you have staff, stock or VAT.

  • Huge app marketplace and the accountant industry standard
  • Strong for VAT, payroll and multi-user limited companies

From about £15/mo

See Xero

We may earn a commission if you sign up through one of these links. It never changes what we calculate, what we recommend, or the order they appear in.