GainsEngine GainsEngine  for UK CGT

Input reference · Columns and activity types

Input file format.

The calculator accepts CSVs, TSVs, or spreadsheets with a single header row followed by one row per event. Column order does not matter, names are not case-sensitive, and unrecognised columns are safely ignored.

See the Examples page to view sample formats for each event type.

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:

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.

Mandatory column names
ColumnRequiredNotes
event,
(alternative: direction, action or type)
yesBUY or B: purchase of shares
SELL or S: sale of shares
ERI or E: excess reportable income
REORG or R: corporate reorganisation (splits, bonus issues, consolidations)
TRANSFER or T: transfer to spouse
RIGHTS or RB: rights issue
RIGHTS_SALE or RS: sale of rights
NOTIONAL or N: accumulation-fund reinvested distribution
EQUALISATION or EQ: accumulation-fund equalisation
LOSS or L: a capital loss you are reporting yourself (case-insensitive)
date,
(alternative: trade_date)
yesdd/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 & rightsNumeric 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 GBP unless an alternative currency is specified in the optional price_currency column.

Numeric data or blank.
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.

Optional column names
ColumnRequiredNotes
costs,
(alternative: cost)
noNumeric data or blank. Dealing fees and commissions. Defaults to 0.
stamp_duty,
(alternative: tax)
noNumeric 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)
noThree-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)
noCurrency 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)
noCurrency 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 stamp_duty values as GBP.

price_fxratenoCustom 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.

Output column names
ColumnRequiredNotes
price_localnoOriginal price before conversion - allowing downloaded versions to be uploaded again unchanged.
cost_localnoOriginal costs before conversion. Serves the same round-trip purpose as price_local.
stamp_duty_localnoOriginal stamp_duty before conversion. Serves the same round-trip purpose as price_local.
price_gbpnoThe 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_gbpnoThe costs column in sterling, after conversion. Read as costs when the file is uploaded again.
stamp_duty_gbpnoThe 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.

Reference data column names
ColumnRequiredNotes
code,
(alternative: instrument, ticker, symbol or isin)
yesThe instrument identifier, written the same way as in your transaction file, e.g. TG46.L. Case-insensitive. Each code can appear only once.
asset_typeyesOne 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.

Asset type values
ValueUse forTreatment
listedShares 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.
unlistedOther shares and securities, for example AIM shares.Reported in the unlisted shares and securities section.
cryptoCrypto-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.
otherAssets that are not shares, securities or crypto-assets.Reported in "Other property, assets and gains".
exemptInvestments 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.

Delimiter format, CSV or text files

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.