Wednesday, 28 January 2026

A free tool for Trading 212 UK Capital Gains Tax calculation!

If you have a Trading 212 Invest account, you will probably need to calculate your Capital Gains tax after May 6th 2026.

Note that the annual report from Trading 212 does not account for the HMRC 30-day rule or the same day rule to determine which shares have been sold. Any sell is first matched against...

    1. Shares bought and sold on the same day
    2. Shares acquired within the 30 days after the sale (on a ‘first in, first out’ basis)
    3. The Section 104 holding pool (any other of the same type of shares: total paid / qty)

I have made a Windows executable that converts the .CSV files which you can download from Trading 212.

On the T212 site, select your Invest account and then use:

'Trading 212 - History' 

and my program will convert your downloaded .csv file into a suitable text file (.txt) which you can then load into the free cgtcalculator.com online app. 

The steps are:

1. Download your CSV files from Trading212. 

T212 only allows 12 months at a time (stupidly). So if the first trade is older than 12 months ago, you need to download all CSVs for all years. Note that you should only select ORDERS.


Example - Orders - only 12 months allowed!

Note that, for HMRC reporting, you should do this after May 6th 2026 (30  days after tax year end) because of the 30-day rule. You need ALL orders in the CSV for all previous order buys/sells since you opened the account.

I suggest you use a start date of Jan 1 and an end date of 31 Dec for each download accordingly - e.g. T212_2024.csv, T212_2025.csv, etc.

2. Download and run the T212_convert.exe (version 11 or later). The .exe file can be copied to any folder or even your Desktop.

You can now get the latest versions from my blog page here.

Double-click on the .exe file to run it, and choose all of your downloaded .csv files:

Hold down Ctrl key and select each download file.

You should see a box like this. If you are prompted about a stock split, it may be because there really was a stock split or it may be because there are missing orders (you have accidentally not included all dates in your downloads). Duplicate orders will be ignored, but you must not have missing orders.

Multiple CSV files produce combined_temp files.

You should check all stock split or oversell warnings/errors. In the screenshot above, the NFLX stock split has not caused an error because the orders have been adjusted, however CNQ seems to have undergone a stock split even though there was no stock split entry in the downloaded .csv file. The CNQ orders need to be fixed. The program can fix simple cases but you will need to check when the split occurred as it may have affected previous Buys and Sells.

The conversion program will parse 'Buy' and 'Sell' rows - including any Market Buy/Sell, Limit Buy/Sell and Stop Buy/Sell orders.

There are two main output files - one is a .csv file with headings, but the other is a .txt file suitable for input into the free cgtcalculator.com tool. The two files will have _CVT appended to the name (CVT=converted). In later versions there is also a warnings.csv file which you may find useful for finding errors by loading into Excel.

If you selected more than one file - a T212_Convert_Combined_Temp files will be created. Note that this file may be overwritten by later runs of the convert program.

If you need to manually edit the results, then you could also load the xxxx_CVT.csv converted file into Excel, make your changes and then select and copy all the data cells using Ctrl+C (not the heading row) and paste it into the cgtcalculator.com form using paste Ctrl+V.

3. Go to the cgtcalculator.com site and click on 'Choose File' and then select the _CVT.txt file. 

  1. Now click on 'Format/Sort' and check it looks OK (optional - it sorts by date)
  2. Ensure the 'apply rounding' option is unchecked - see picture below.
  3. Enter the desired tax year if you don't want all years. 
  4. Finally click on the red CALCULATE button.


Note that the CapitalGain figure (e.g. 6713) can be used in your tax return.

Note that cgtcalculator.com does not calculate ERI on accumulating ETFs and so does not subtract ERI from any gains (see end of this article for more info on ERI). If you are a basic rate tax payer, this may mean you will be paying slightly too much capital gains tax.

cgtcalculator.com conversion programs for Windows

You can now get the latest versions from my blog page here.

If you don't trust running strange .exe files from me then you can examine and run the .py script after you have installed python onto your Windows system.

*Check this page for future revisions or contact me. Unzip to extract the .exe file.
An interactive investor (ii) program is also available because there are bugs in the converter for ii that is on the cgtcalculator.com site.

Extract the .exe file to the same folder that you have your .csv files in if using a command line version.

The .exe program is written in Python and has then been compiled into a Windows .exe. I used ChatGPT to make it for me since I don't know Python very well.

Action of T212_convert (latest version 11.5)

  • Read in .csv - this may contain multiple files and duplicate lines. Files containing orders can be downloaded from T212 - ALL ORDERS for ALL YEARS must be downloaded and added to the one file - if you held the account for 6 years then all trades for all 6 years are needed. Downloads for the last year must be done after May 6th as trades up to 30 days after the tax year may affect the calculations. Later versions (v11+) allow you to select multiple files from a Windows pop-up.
  • Check and sort Buy and Sell orders
  • Adjust Qty and Price in shares if a stock split is present or detected
  • Check for Oversells (selling more shares than you hold) and small discrepancies (e.g. hold 9.0 but sell 9.0000001 shares)
  • Check for any Buy within 30 days of a sell (HMRC same day and 30-day rules will apply when processed later) - warn user
  • List number of Buys and Sells
  • List files output inc a Warnings .csv and a .csv which user can manipulate and then cut and paste into cgtcalculator.com
  • List orders which have been changed by the program (due to small discrepancies, splits, etc.)
  • The .txt file can be directly imported into cgtcalculator.com

Note: Sometimes, in cgtcalculator.com, the sells do not match the buys by a very small amount due to very small decimal errors (the sells in the T212 downloaded csv dont always add up exactly to the buys). These may be detected and corrected automatically.

cgtcalculator.com may display an error:

**** ERROR in trades data(283) There are more SELLS than BUYS for stock SOFI OR your dates are incorrect (make sure at some time you havent sold more than you own) for stock SOFI

An easy way to fix this is to very slightly increase the number of the shares bought. e.g. increase 4.53212 shares bought to 4.53213 shares bought or very slightly decrease the number sold within the cgtcalculator.com edit box. T212_convert version 4+ and ii_convert_v3 may automatically fix these small discrepancies for you.


Tip: Saving as .csv file

When saving in Excel as a .csv, only use the first .csv option - do not use the MS-DOS or Macintosh options for a .csv file or you will get strange characters in the .csv file...

The xxx_warnings_CVT.csv output files contains lines which cannot be handled by the conversion program - e.g. stock split notifications.

Example of a stock split anomaly (in the .txt output file)

Most stock splits should be dealt with by the convert program.

However, sometimes there may have been a stock split which will cause an error and so needs to be manually adjusted by you.

B 10/06/2024 CNQ 1.652028 55.9555 0.00 0.00
S 18/06/2024 CNQ 3.304056 26.4765 0.00 0.00

This will cause an error to be detected by cgtcalculator.com as I seemingly only bought 1.65 shares but sold 3.30 shares! This was because there was a x2 stock split after June 10th.

We need to re-calculate the buy price by dividing the original buy price by 2 (55.9555/2) and then doubling the quantity...

B 10/06/2024 CNQ 3.304056 27.97775 0.00 0.00
S 18/06/2024 CNQ 3.304056 26.4765 0.00 0.00

The output .txt file (or the data in the cgtcalculator.com data field box) must be manually edited. It is now more obvious to the calculator that I managed to make a loss in just 8 days ;-(

Or I could simply work out the loss/gain manually and delete the two rows from the .csv file.


Multiple GIA accounts?

If you have more than one General Investment Account, then you should combine all orders into one single .csv or .txt file before using with cgtcalculator.com.  e.g. You may hold BP shares in both Trading 212 and Interactive Investor accounts. Because you may have bought say BP on Trading 212 but sold some BP two days later on say Interactive Investor. According to the 30-day rule, that sale is not counted for tax purposes.

If you always held different shares in different GIAs at any one time, then there is no need to combine all orders into one .csv file.


Other converters

The cgtcalculator.com site has some converters but not one for Trading 212 AFAIK.


The ii one has a bug when dealing with $USD shares however. You can use my ii_convert program instead.

Excess Reportable Income (ERI)

If you are a standard rate tax payer and have sold accumulating ETFs in your GIA, you may be paying too much CGT. If you are a higher rate tax payer, you may be paying too little tax.

You should work out the ERI over all the years you have held each accumulating ETF for and then deduct the total ERI from the gain you made when you sold the ETF. See here for more details.

In my case, I try to avoid buying accumulating ETFs inside my GIAs and buy distributing ones instead so that I don't have to work out the ERI.

cgtcalculator.com ignores ERI and so you may be paying a bit too much or too little tax.

Please let me know if you have any comments or problems with the converters.

An easy way to find the ERI figure is to search for the ISIN number of the ETF on https://www.kpmgreportingfunds.co.uk (free login required) and choose the year that the ETF was held in. The ISIN number for any stock ticker can be looked up on your broker's site - e.g. Trading 212.


New online calculator tool - UK Tax Calculator!

P.S. I have just found a Reddit post with a link to this free online tool. It looks very comprehensive and easy to use. 

Just use Ctrl+left-click to select all your downloaded files from your broker site.

This tool currently supports the following brokers:

  • Interactive Brokers (IBKR) - Activity Statement CSV exports
  • Charles Schwab - Transaction History CSV exports
  • Trading 212 - Transaction CSV exports (Invest/GIA accounts only)
  • Vanguard UK - Transaction History XLSX exports
It says you can upload more than one file too. It deals with same day and 30-day rules as well as the Section 104 averaging rule too. Amazingly, this tool also tries to adjust dividends and capital gains for ERI (optional).

I have compared cgtcalculator.com results with this new UK Tax Calculator for Trading 212 and now (10 Feb 2026) with the ERI option unticked, they both give the same results for Trading 212.

Tip: If using this program - be careful not to change the date format if you load the .csv file into Excel and re-save it - e.g. for T212 you must keep the custom date format of yyyy-mm-dd hh:mm:ss for the date column in the .csv file.

No comments:

Post a Comment