How It Works

The calculator is on the Home page. See How to use page for instructions.

UKCGT is a browser-based UK capital gains calculator for shares and funds so that you can accurately report your gains to HMRC- it does not calculate your tax bill, HMRC will do that. UKCGT lets you load multiple .csv / .txt broker files (or paste trades in directly), then converts supported broker formats into a common cgtcalculator.com-style trade list. Results should be identical to those of cgtcalculator.com, the well used and trusted CGT site, but my calculator accepts different and multiple .csv files without needing conversion first.

The UKCGT calculator applies the main HMRC share matching rules: same-day matching, 30-day bed-and-breakfast matching and Section 104 pooling. It produces a tax-year summary, disposal-by-disposal calculations, and current Section 104 holdings. It does not calculate tax due, apply annual exemptions, carry forward losses, spouse transfers, reorganisations, options or pre-6 April 2008 rules. The TEST button on the calculator page shows you an example where ERI DIVIDEND entries have also been added onto the share buy/sell entries of various ETFs (offshore funds). For most cases, we will have just two types of trades rows – Buy or Sell transactions:

  • B or BUY – purchase of stock
    B Date Company Shares Price Charges Tax
  • S or SELL – sale of stock
    S Date Company Shares Price Charges Tax

UK HMRC tax rules say that you should report Excess Reportable Income (ERI) on any reportable Funds which may have been paid on both Accumulating and Distributing ETFs. For instance, if you have an accumulating ETF in your GIA, you need to look up and report the dividends that may have been invisibly paid into the ETF and report it as a Foreign Dividend or Foreign Interest as most ETFs are offshore funds (e.g. Ireland or Luxembourg). Most brokers do not report ERI at all in their tax year reports or indeed any report – mainly, I suspect, because it is very difficult to obtain the data from the ETF providers and quite complex to calculate. Any notional ERI is only deemed as having been paid if you held the ETF on a certain specific day of the year (the reporting date).

ETF ERI notional dividend/interest payments can be looked up and calculated using my ERI_Lookup page here. ERI Lookup has been automated as much as possible (just paste in the Trades from the main calculator page). The calculated ERI notional payments can then be pasted as dividends into the main calculator form with the click of a button – each dividend will be added onto the cost of the ETF to decrease your capital gain – this may well save you tax if you are a basic rate tax payer.

Supported transaction CSV files include those downloaded from Trading 212, Barclays (xls exports must be first saved as CSV), Interactive Investor, Interactive brokers, Lightyear/Sharesight, HL, FreeTrade, AJ Bell, and cgtcalculator.com in text format. Multiple files in different broker formats should be selected in the file picker and trades are combined into one report. Duplicate Trading 212 and Interactive Investor rows are removed by looking for identical broker reference IDs, but try to avoid accidentally including duplicate trades if possible. You may be warned if identical trades are found – e.g. if you bought the exact same number of shares for the same price on the same day then you may have accidentally included a duplicate trade and are thus warned of this.

Stock splits are supported for Trading 212 and I have added in some detection code to identify a stock split even if not reported in the CSV transaction file. If you have problems with any example data containing stock splits, please contact me and I will add in support.

All processing runs locally in the user’s browser. The page does not submit your private trade data to the server – trade data does not leave your device.

Stock Distributions – These are treated as a 0 cost purchase when found in Broker CSVs (e.g. supported in Trading 212 parser) but the correct way to deal with it is usually to adjust the pool cost of the parent stock manually and then add the cost of the new share distribution as a buy. ukcgt.xyz recognises these transaction types:

  • B or BUY – purchase of stock
    B Date Company Shares Price Charges Tax
  • S or SELL – sale of stock
    S Date Company Shares Price Charges Tax
  • DIV or DIVIDEND – adds an amount to the current pool (usually used for ERI)
    DIVIDEND Date Company Shares Price (the Shares quantity should match the pool quantity).
  • POOL or POOL_ADJ – can adjust the pool cost of any stock at any specified date (as a check, the number of shares in the pool should roughly match) – typically used when a stock distribution has decreased the value of a parent stock and the user must adjust the pool value of the parent stock. You can use a negative price. e.g.
    POOL_ADJ     01/07/2025   FTV          100           -20
    the pool cost is reduce by £2000

The calculator does not know which stock is the parent stock or the nature of the distribution – you may need to change the cost of the new distributed shares from 0 and then use a new POOL_ADJ to reduce the pool cost of the parent stock by the same amount. Check the details of the distribution and the HMRC rules.

Unlisted shares

HMRC require you to report any capital gains from unlisted shares separately, e.g. gains/losses from AIM shares.

Category              Year      Disposal proceeds   Allowable costs   Net Gain/Loss
Listed shares         2025/26   £188,499            £179,529          £8,970
Unlisted shares (AIM) 2025/26   £1,896              £1,720            £176

ukcgt.xyz will check all your share tickers to see if any are AIM shares and list them as Unlisted shares. This check may take a while on the first calculation run, but subsequent runs will use the cached results and thus be much faster. If the same ticker symbol exists in multiple stock exchanges and cannot be identified, it will be assumed to be a listed share. Check the log to see if the ticker lookup was correct. If the ticker actually was an AIM share, you can try adding .L to the ticker, e.g. use RFX.L instead of RFX or add .AIM to force it to be treated as unlisted on the date it was sold (e.g. AT.AIM). For most people (not a business share account or require Investors’ Relief or Business Asset Disposal Relief), the capital gains tax treatment is the same for both listed and unlisted shares, so many calculators do not bother to separate listed trades from unlisted trades.

You can compare the results of my free ukcgt.xyz calculator to others such as FiscalFox.com – both should give similar results.

Other Tools

StockWatcher allows you to set alerts and you can even receive alerts on your mobile phone without needing to supply my site with any personal details.

TrendTracker allows you to quickly create and chart dozens of different portfolios and identify and compare trending stocks.

The main script was written using Codex and ChatGPT 5 or later and some using Claude. The website has been designed to be functional and easy to use (rather than pretty).

Scroll to Top