Multiple file processing
You can upload more than one file at a time, for example from different brokers or for different time periods. This includes the option to add a reference data file.
Transaction Data
The calculator processes your trade data consistently while being designed to be flexible with user data.
A generalised format is defined for the calculator, allowing users to map broker data onto the standardised format. As your requirements become more complex, additional optional columns can be added to the dataset to provide more information for processing.
You can import your supported data file directly into the calculator page, or copy-paste delimited text directly.
Corporate Actions
Corporate actions, such as corporate restructuring events (splits, consolidations and rights issues) and ERI payments, can be kept in a separate file from your transactions. Upload it alongside your transaction file and the calculator combines the two. The file uses the same columns as the transaction data. See the Examples page for the format of each event.
Reference Data (optional)
By default, the calculator processes all data as listed securities, such as shares listed on a recognised stock exchange,
UK OEICs and authorised unit trusts. This needs no extra information.
If your data includes a mix of asset types, such as Gilts, unlisted securities or crypto-assets, you can add an optional reference data file alongside your transaction file. State the applicable asset type (from the list of valid types) for each investment code, and the calculator applies the correct treatment to that investment: applying the disposal values to the relevant section of the SA108, or leaving exempt investments such as Gilts out of the calculation. See Reference data format.
Data formatting
Key Guidelines:
- Flexible Headers: Common column names are automatically recognised (case-insensitive). If mandatory columns or data are missing, a warning will be displayed.
- Preview Table: After importing data, review the preview table to check how your file was interpreted and resolve any highlighted warnings.
- Date Formats: Dates must use UK format (
DD/MM/YYYY) or ISO 8601 (YYYY-MM-DD). - Multiple Accounts: Combine transaction histories from all broker accounts into a single file to ensure HMRC matching rules are applied accurately across your entire portfolio.
- Complex Events: See the Examples page for detailed formatting on corporate actions, fund distributions, and transfers.
- Currency Handling: All values are assumed to be
GBPunless an alternative currency is specified in the optional currency columns. - Asset Types: All investments are treated as listed securities unless a reference data file says otherwise.
Mandatory Columns
These columns are required for processing.
The units column data is only required for trades, transfers, and rights issues; leave it blank for all other event types.
| Column | Required | Notes |
|---|---|---|
event,(alternative: direction, action or type) | yes | BUY or B: purchase of sharesSELL or S: sale of sharesERI or E: excess reportable incomeREORG or R: corporate reorganisation (splits, bonus issues, consolidations)TRANSFER or T: transfer to spouseRIGHTS or RB: rights issueRIGHTS_SALE or RS: sale of rightsNOTIONAL or N: accumulation-fund reinvested distributionEQUALISATION or EQ: accumulation-fund equalisationLOSS or L: a capital loss you are reporting yourself (case-insensitive) |
date,(alternative: trade_date) | yes | dd/mm/yyyy or yyyy-mm-dd. For ERI event rows, use the fund's reporting date |
code,(alternative: instrument, ticker, symbol or isin) | yes* | The instrument identifier, e.g. BARC.L. Case-insensitive, automatically converted to uppercase. *Optional on LOSS rows, which are not holdings. |
units,(alternative: quantity) | trades, transfers & rights | Numeric data or blank. Positive number. Leave blank on ERI, REORG, RIGHTS_SALE, NOTIONAL, EQUALISATION and LOSS rows |
price,(alternative: price_per_unit) | yes* | Note: All values are assumed to be ERI: income per unit. REORG: split/bonus ratio. RIGHTS: subscription price per share. RIGHTS_SALE: total proceeds. NOTIONAL / EQUALISATION: total amount for the holding. LOSS: the total loss amount (positive number). *Leave blank on TRANSFER rows. |
Optional Columns
Optional columns can be omitted entirely.
Unspecified currency columns or currency values default to GBP, and missing cost values default to 0.
| Column | Required | Notes |
|---|---|---|
costs,(alternative: cost) | no | Numeric data or blank. Dealing fees and commissions. Defaults to 0. |
stamp_duty,(alternative: tax) | no | Numeric data or blank. Stamp Duty (or SDRT). Defaults to 0. SDRT are aggregated with costs in the calculator. |
price_currency,(alternative: price_cncy or price_ccy) | no | Three-letter currency code (e.g. USD, EUR). Defaults to GBP. If the column is provided and currency codes are missing, these rows will process price values as GBP. Prices are converted to sterling using the transaction date exchange rate. |
cost_currency,(alternative: costs_currency, costs_cncy, cost_cncy or cost_ccy) | no | Currency code for transaction fees. Does not inherit the currency from price_currency. UK broker costs will often still be in pounds even for foreign trades. Defaults to GBP. If the column is provided and currency codes are missing, these rows will process costs values as GBP. |
stamp_duty_currency,(alternative: stamp_duty_cncy, tax_currency, tax_cncy or stamp_duty_ccy) | no | Currency code for stamp duty, converted to sterling like price. Defaults to GBP. If the column is provided and currency codes are missing, these rows will process |
price_fxrate | no | Custom exchange rate override for price. Expressed as foreign currency per £1 GBP, GBPXXX (e.g. GBPUSD 1.30). Use when an exchange rate is provided. Requires the price_currency to be specified for completeness. |
cost_fxrate,(alternative: costs_fxrate) | no | Custom exchange rate override for costs. Expressed as foreign currency per £1 GBP, GBPXXX. Requires the cost_currency to be specified for completeness. |
stamp_duty_fxrate,(alternative: tax_fxrate) | no | Custom exchange rate override for stamp_duty. Expressed as foreign currency per £1 GBP, GBPXXX. Requires the stamp_duty_currency to be specified for completeness. |
Output Columns
These reference columns appear in the downloadable output files when currency conversion is applied, retaining the unadjusted values, prior to conversion to GBP.
| Column | Required | Notes |
|---|---|---|
price_local | no | Original price before conversion - allowing downloaded versions to be uploaded again unchanged. |
cost_local | no | Original costs before conversion. Serves the same round-trip purpose as price_local. |
stamp_duty_local | no | Original stamp_duty before conversion. Serves the same round-trip purpose as price_local. |
price_gbp | no | The price column in sterling, after conversion. It takes the place of price in the converted file, and is read as price when that file is uploaded again. |
costs_gbp | no | The costs column in sterling, after conversion. Read as costs when the file is uploaded again. |
stamp_duty_gbp | no | The stamp_duty column in sterling, after conversion. Read as stamp_duty when the file is uploaded again. |
Reference data format
A reference data file is a separate, optional file uploaded alongside your transactions. It has exactly two columns, with one row per investment code.
It uses the same file formats and delimiters as the transaction file.
| Column | Required | Notes |
|---|---|---|
code,(alternative: instrument, ticker, symbol or isin) | yes | The instrument identifier, written the same way as in your transaction file, e.g. TG46.L. Case-insensitive. Each code can appear only once. |
asset_type | yes | One of the values in the table below, case-insensitive. Must not be blank: remove the row instead. |
Asset type values
Investments not named in the reference data file are treated as listed. Codes in the file that are not in your transactions are ignored.
| Value | Use for | Treatment |
|---|---|---|
listed | Shares and securities listed on a recognised stock exchange, UK OEICs and authorised unit trusts. | The default. Reported in the listed shares and securities section of the SA108. |
unlisted | Other shares and securities, for example AIM shares. | Reported in the unlisted shares and securities section. |
crypto | Crypto-assets, e.g. BTC. | Reported in the crypto-assets section from 2024-25, and in "Other property, assets and gains" for earlier years. A crypto-asset code cannot be given another type. |
other | Assets that are not shares, securities or crypto-assets. | Reported in "Other property, assets and gains". |
exempt | Investments exempt from Capital Gains Tax, such as Gilts and qualifying corporate bonds. | Left out of the calculation entirely. Its transactions are listed in a separate file in the download. |
Matching (same day, 30 day and Section 104 pool) works the same way for every type except exempt. You decide each investment's type: the calculator does not guess it from the code. See HMRC's SA108 notes.
Foreign currency
HMRC requires all capital gains calculations to be performed in sterling using transaction date exchange rates. Because FX rates fluctuate, trades with no net gain or loss in foreign currency may still generate a UK taxable gain or loss in GBP.
Exchange Rates
The calculator automatically applies daily European Central Bank reference rates for major currencies from 2000 onward (see Scope). If a rate is missing for a specific date or currency, the import preview will display a warning and prompt you to provide your own rate or pre-convert the values to GBP.
Multi-Currency Support
If you have a mixed currency dataset, add the relevant optional currency column to the dataset for each value column containing a foreign currency value, and add the currency code.
The absence of a currency column, or the omission of a code within the currency column defaults to GBP for that row or value range.
- Currency Codes: Add the appropriate currency column (e.g.,
price_currency) and specify a 3-letter code for non-GBP trades. UseGBXfor prices entered in pence. - Independent Currency Fields: Each monetary column (price, costs) has its own independent currency and rate fields. Prices in USD do not automatically assume costs are in USD.
- Custom FX Rates: Use rate columns (e.g.,
price_fxrate) to override the built-in rates with specific contract note settlement rates. Custom rates require a matching currency code to be explicitly defined. - Rate Convention: All exchange rates must be specified as GBP/XXX (units of foreign currency per £1 GBP). For example, use
1.34for GBP/USD or1.16for GBP/EUR. Amounts are divided by this rate to calculate the sterling value. - Fixed Currency Rules:
GBP(Pounds) andGBX(Pence) convert at fixed ratios (1 and 100 respectively). Custom exchange rates assigned toGBPorGBXthat contradict these ratios will be rejected. - Audit Trail: Downloadable reports include all applied exchange rates and calculated GBP conversions for record-keeping.
Delimiter format, CSV or text files
- Data format: Include one header row followed by one row for each transaction or event.
- Supported delimiters: commas, semicolons, pipes (|), or tabs. Delimiters are detected automatically, but must remain consistent throughout the file.
- Column names: Ensure mandatory columns are included, and there are no duplicate column names.
- Column values: Check column values match the expected format and spelling.
Spreadsheet format
While CSV files are preferred, the calculator also supports spreadsheet files. When uploading spreadsheets, ensure proper formatting to avoid data loss or parsing errors.
- File Formats: Spreadsheet files can be uploaded in .xlsx, .xls, or .ods formats.
- Layout & Saving: Ensure the transaction table starts in cell A1 (header in row 1, data starting contiguously in row 2). If your workbook has multiple tabs, save the relevant sheet as the active tab before uploading.
- Locale & Dates: Set your spreadsheet locale to the UK to avoid errors caused by US date formats (MM/DD/YYYY) or European comma decimals (1.000,00).
- Precision: Do not apply visual display rounding to cells prior to exporting. Keep numbers unrounded for full precision.