Computing Capital Gains Tax

Hi, I have a few quick questions on capital gains reporting in the UK to HMRC. I have a T212 non-ISA account and they send a monthly disposals report where the ‘result’ column is the GBP pnl from the shares sale relative to the average price of obtaining the position (including relevant fx rates).
I am assuming this cannot be used for tax return purposes due to the complexity of the share matching rules? For example capital gains tax rules match a disposal of shares with any acquisition in the following 30 days.
In which case the only option to evaluate gains / losses in line with HMRC rules is to the collate all the daily contract note statements and plug that into a CGT calculator or give to a tax advisor to compute?
Just wondering if this is how others have typically handled this for t212 non-ISA accounts and if so any recommendations on software / apps to work out CGT from a list of share purchases and sales would be appreciated.


1 Like

I keep track using a Google sheet diary of all my transactions. But mostly when I sell my cost is the average price in my Section 104 holding of the stock. In the rare cases of needing to apply 30 day or same day matching rules I do that by hand. However, I could see how someone who buys and sells thousands of times a year and needs to frequently apply matching rules would have end up with a big job. I guess there must be software that does this.

On there are is this amusing post:

Many years ago one of our clients started CFD trading.

He enclosed a 20 page document detailing all of his transactions… it took one of our trainees 3 days to complete the CGT pages of his tax return… I think the client made about £50 profit overall.

I wonder how much they charged that client for the 3 days of accounting work!

There does exist software that will do the calculation correctly. But is expensive and only really purchased by professional accountancy firms that are preparing many self assessment tax returns for clients. The cheaper software, like Taxcalc, cannot handle these calculations.

I am sure there are people on this forum with the programming skills to automate the computations, taking as input the .csv transaction downloads that are now available to us. Most people should be able to do it by starting with the .csv file and sorting by ISIN and date, to see for example all AAPL stock transactions in date order.

Hunting around, I found this calculator which may be interesting to evaluate.
I’ve had a little play around with this. It looks good!

Welcome to CGTCalculator - keep track of your capital gain

Anyone who has tried working through the Inland Revenue matching rules for share trades will know that the process can quickly become very complicated for even a modest number of trades. The 30 day rule especially can cause unexpected gains/losses. The purpose of this site is to help UK tax payers to calculate, and to keep track of, their capital gain (or loss) based on their share trades. This is important for effective tax planning and can potentially save you a significant amount on your tax bill.
This calculator is updated every tax year and is fully up to date for the 2020-2021 tax year.

This capital gains calculator matches in excess of 10,000 share trades according to the Inland Revenue’s share matching rules. Simply paste your trades into the box below and click the CALCULATE button. Alternatively if your trades are in *.txt or *.csv format then you can drag and drop or use file upload. Check other pages for instructions and examples. Use the conversion utilities to directly use your online broker’s trade history information. Click here for info on printing/saving.


I thought T212 provided tax reports if you ask for them? However there are implications if you buy and sell the same shares on another platform, so if they calculate capital gain it may not be correct when taking into account other platforms.

The Trading 212 reports will not necessarily calculate correctly your capital gains and losses, even if you have no trades on other platforms. The problem is the share matching rules. See

Hmm, I expected the reports to take the rules into account. I hope they at least report income correctly?

I wrote a python command-line tool that calculates capital gain for cryptocurrency transactions which may also be suitable for shares: GitHub - MatthewLM/PyCryptax: UK Income and Capital Gains Tax Calculator for Cryptocurrencies

However someone else forked my project to create a version specifically for shares which might be more suitable though I’ve not yet used it: GitHub - mgalushka/StocksTax: UK Capital Gains Tax Calculator for Stocks