Skip to content

ShareCalc CSV Format

The ShareCalc CSV format lets you import transactions directly without using a broker-specific parser. Each line represents one transaction.

A header row is optional. Without one, columns are read positionally in the order below. With one, columns may appear in any order and optional columns may be omitted — see Header row.

A headerless row must have at least 4 columns. Trailing optional columns may be omitted, but note that asset and quantity columns are always paired: you cannot include one without the other, so column counts of 5, 7, 9, or 11 are invalid. The maximum is 20 columns.

Generally, numbers are always positive, but exceptions apply as detailed below. The base asset represents the asset the transaction operates on.

To import a CSV file, go to the Import section, select CSV as the file format, and follow the instructions on screen.


Schema

Column Definitions

The Header column gives the identity string used to name each column in an optional header row.

# Name Header Format
0 Transaction Type transaction_type String
1 Date date Date / Datetime
2 Base asset base_asset Asset ID
3 Base quantity base_quantity Decimal
4 Out asset out_asset Asset ID
5 Out quantity out_quantity Decimal
6 Fees asset fees_asset Asset ID
7 Fees quantity fees_quantity Decimal
8 Tax asset tax_asset Asset ID
9 Tax quantity tax_quantity Decimal
10 Accrued income asset accrued_income_asset Asset ID
11 Accrued income quantity accrued_income_quantity Decimal
12 Tax country tax_country Country
13 Ex-date ex_date Date
14 Settled date settled_date Date
15 Extra extra String
16 Financial Institution Transaction ID transaction_id String
17 Financial Institution Account ID account_id String
18 Note note String
19 Conversion conversion Conversion

Header row

You may include an optional header row as the first line of the file. It is detected automatically: if the first line contains the transaction_type and date identity strings, it is treated as a header rather than a transaction. Identity strings are not case sensitive.

When a header is present:

  • Columns may appear in any order.
  • Optional columns may be omitted entirely (rather than left empty).
  • Unknown columns are ignored, so you can point ShareCalc at an existing file (e.g. a broker export) and map only the columns you need — any other columns are skipped and listed in the import messages.
  • transaction_type and date are required.
  • A known column may not be repeated, and each data row must have exactly as many columns as the header.

Example

The following reordered file with a header is equivalent to a positional file containing the same transactions:

date,transaction_type,base_quantity,base_asset,out_quantity,out_asset,extra
2022/06/01 10:40:06,BUY,1000,AAPL,57276.25,GBP,
2024/07/15,CAP_DIST,,AAPL,50.00,GBP,

Unknown columns such as broker_ref below are ignored:

transaction_type,broker_ref,date,base_asset,base_quantity,out_asset,out_quantity
BUY,REF123,2022/06/01 10:40:06,AAPL,1000,GBP,57276.25

Transaction Types

The first column of every row is the transaction type code.

CSV Value Label Category
BUY Buy Trade Trade
SELL Sell Trade Trade
DIV Dividend Attributed Income
M_DIV Manufactured Dividend Attributed Income
N_DIV Notional Dividend Attributed Income
INT Interest Attributed Income
M_INT Manufactured Interest Attributed Income
INT_PAID Interest Paid Attributed Income
N_INT Notional Interest Attributed Income
PID Property Income Distribution Attributed Income
M_PID Manufactured Property Income Distribution Attributed Income
NGNL_TRANSFER No Gain/No Loss Transfer No Gain/No Loss Transfer
SPLIT Split Share Reorganisation
REV_SPLIT Reverse Split Share Reorganisation
BONUS Bonus Issue Share Reorganisation
SPIN_OFF Spin Off Spin Off
CAP_DIST Capital Distribution Capital Distribution
RIGHTS_TAKE_UP Rights Take Up Rights Take Up
BROKER_INT Broker Interest Unattributed Income
BROKER_INT_PAID Broker Interest Paid Unattributed Income
WDL Withdrawal Withdrawal and Deposits
DEP Deposit Withdrawal and Deposits
FEE Fee Fee
FEE_REFUND Fee Refund Fee
OPT_EXERCISE Option Exercise Option Assign/Exercise
OPT_ASSIGN Option Assignment Option Assign/Exercise
OPT_EXERCISE_CASH Cash Option Exercise Option Cash Assign/Exercise
OPT_ASSIGN_CASH Cash Option Assignment Option Cash Assign/Exercise
OPT_EXPIRE Option Expiry Option Expire
BOND_MATURITY Bond Maturity Bond Maturity

See the Transactions page for a description of each type.

Asset identifiers

Every asset column (base, out, fees, tax, accrued income, and the two assets in a conversion) holds a single identifier. ShareCalc works out what kind of identifier it is from its shape: a value that is a valid ISIN, CUSIP or SEDOL, including its check digit, is treated as that identifier; anything else is treated as a symbol. Case and surrounding spaces are ignored.

The value is then matched against the assets in your file on that identifier alone. An ISIN only matches assets by their ISIN, a symbol only by their symbol. A SEDOL also matches an asset that has no SEDOL but whose ISIN is derived from it (a UK ISIN such as GB00BH4HKS39 embeds the SEDOL BH4HKS3). If exactly one asset matches, the row is attached to it and any identifier it was missing is filled in. If no asset matches, a new one is created with the value in the corresponding field. If several assets match, the ambiguity is reported and a new asset is created.

An ISIN is the most reliable way to link CSV rows to assets that came from broker imports, and it is enough for ShareCalc to recognise UK gilts and HMRC reporting funds from its reference data.

Currencies

The file carries no asset types, so ShareCalc works out which identifiers are currencies from how the file uses them:

  • A value in a column that can only hold cash is a currency. That is the fees, tax, accrued income and conversion columns for every transaction type, and the out asset for every type except deposits, withdrawals and spin-offs. Once an identifier is recognised as a currency it is treated as one everywhere in the file, including as the base asset of a deposit or an FX trade.
  • A value that is one of the following ISO codes is a currency wherever it appears: GBP, USD, EUR, JPY, CHF, CAD, HKD, SGD, SEK, DKK, NZD.

Any other value in a base asset or a deposit's out asset is left unclassified, even if it is a valid currency code, because codes such as NOK and AMD are also share tickers. A file that only deposits such a currency creates an unclassified asset; either add a row that uses the currency as consideration or fees, or create the currency in the app first so the import matches it by symbol.

Column 12: Tax country

Column 12 is the country whose tax rules apply to an income transaction, for example the country that withheld tax on a dividend. It is only used for income transactions and must be empty for all other types.

The value is a three letter HMRC self assessment country code in upper case, for example GBR, USA or IRL. See Country Codes for the full list. These are the codes HMRC uses on the foreign pages of the tax return and match the ISO 3166 alpha-3 codes for most countries. Country names and two letter codes are not accepted.

If the column is empty, the tax country of the base asset is used, or the tax country of the broker for broker interest.

Column 15: Extra

Column 15 contains semicolon-separated flags and key=value pairs. It can be left empty if none apply.

Key Format Description
ratio= out:in Reorganisation ratio
u_qty= Decimal Underlying quantity
oc= O,C,OC Open/close flag. O: open position, C: close position, OC: close previous position and open new position in opposite direction
E flag Tax exempt
eq= Decimal Equalisation component of a fund distribution (dividend/interest/notional rows on fund assets only). The amount is a portion of the row's out amount and is in the same currency; the row must have an ex date.

Examples

u_qty=10;oc=C
ratio=2:1

A fund dividend of 100 of which 42 is equalisation:

DIV,2022/06/05,BND,,GBP,100,,,,,,,USA,2022/06/02,,eq=42,,,

Column 19: Conversion

Column 19 records a currency conversion that your broker performed as part of the transaction, for example a broker that sells US shares and immediately converts the dollar proceeds into pounds. It can be left empty if none applies. The value has three parts separated by |, with an optional fourth part for the broker's exchange fee:

currency|settlement_currency|settlement_amount[|fee_amount]
  • currency: the currency the broker converted. All of the transaction's amounts in this currency (consideration, fees, tax and accrued income) are treated as converted.
  • settlement_currency and settlement_amount: the currency and net amount that actually arrived in or left your account. The amount is always positive.
  • fee_amount (optional): the broker's exchange fee, in the settlement currency. It is already included in the settlement amount.

Examples

$200 of sale proceeds converted to £160 in your account:

USD|GBP|160

The same conversion, of which £0.74 was the exchange fee (£160.74 from the sale - £0.74 in fees = £160):

USD|GBP|160|0.74

Field Formats

Format Description
Asset ID String identifying the asset: a symbol, ISIN, CUSIP or SEDOL. See Asset identifiers
Decimal Numeric value
Date YYYY-MM-DD or YYYY/MM/DD
Datetime A date followed by a time of HH:MM or HH:MM:SS, separated by a space or T, optionally followed by a UTC offset such as +01:00 or Z (e.g. 2022-06-01 10:40:06, 2022/06/01 10:40, 2022-06-01T10:40:06Z). If there is no offset, the time is interpreted in the broker's time zone. The date used for tax purposes is the UK date at that time. A Date on its own is also accepted and is stored without a time
Country See Column 12: Tax country
Conversion See Column 19: Conversion

Transaction Categories

Trade

Types: BUY, SELL

# Name Req Notes
0 Type required
1 Date required
2 Base asset required Asset traded
3 Base quantity required
4 Out asset required Consideration
5 Out quantity required
6 Fees asset optional
7 Fees quantity optional negative allowed for liquidity rebate
8 Tax asset optional Transaction tax
9 Tax quantity optional
10 Accrued income asset optional For gilts
11 Accrued income quantity optional positive/negative
12 Tax country empty
13 Ex-date empty
14 Settled date optional required when accrued income exists
15 Extra optional oc=, E
16 Transaction ID optional
17 Account ID optional
18 Note optional
19 Conversion optional

Examples

BUY,2022/06/01 10:40:06,AAPL,1000,GBP,57276.25,GBP,1.25
SELL,2023/08/01 15:22:42,AAPL,200,USD,100,,,,,,,,,,,,,

No Gain/No Loss Transfer

Types: NGNL_TRANSFER

A no gain/no loss transfer is a quantity-only disposal; the deemed proceeds are derived from the matched acquisition, so no consideration is entered.

# Name Req Notes
0 Type required
1 Date required
2 Base asset required Asset transferred
3 Base quantity required
4 Out asset empty
5 Out quantity empty
6 Fees asset empty
7 Fees quantity empty
8 Tax asset empty
9 Tax quantity empty
10 Accrued income asset empty
11 Accrued income quantity empty
12 Tax country empty
13 Ex-date empty
14 Settled date empty
15 Extra optional E
16 Transaction ID optional
17 Account ID optional
18 Note optional
19 Conversion empty

Examples

NGNL_TRANSFER,2022/07/01 14:22:42,AAPL,60,,,,,,,,,,,,,,,

Attributed Income

Types: DIV, M_DIV, N_DIV, INT, M_INT, N_INT, INT_PAID, PID, M_PID

For PID and M_PID the base asset must be a UK REIT and the withholding tax must be 20% of the gross distribution.

# Name Req Notes
0 Type required
1 Date required
2 Base asset required Underlying
3 Base quantity empty
4 Out asset required
5 Out quantity required
6 Fees asset optional empty for INT_PAID
7 Fees quantity optional
8 Tax asset optional Withholding tax. Required for PID and M_PID, empty for INT_PAID
9 Tax quantity optional
10 Accrued income asset empty
11 Accrued income quantity empty
12 Tax country optional e.g. USA. Defaults to the tax country of the base asset
13 Ex-date optional required for notional
14 Settled date optional empty for notional and INT_PAID
15 Extra optional E, eq=
16 Transaction ID optional
17 Account ID optional
18 Note optional
19 Conversion optional empty for notional

Examples

M_DIV,2022/06/05,BND,,USD,100,,,,,,,USA,2022/06/02,,,,,
DIV,2022/06/05,VTI,,USD,100,,,USD,10,,,USA,2022/06/02,,,,,

Unattributed Income

Types: BROKER_INT, BROKER_INT_PAID

# Name Req Notes
0 Type required
1 Date required
2 Base asset empty
3 Base quantity empty
4 Out asset required
5 Out quantity required
6 Fees asset empty
7 Fees quantity empty
8 Tax asset optional Withholding tax. Empty for BROKER_INT_PAID
9 Tax quantity optional
10 Accrued income asset empty
11 Accrued income quantity empty
12 Tax country optional e.g. USA. Defaults to the tax country of the broker
13 Ex-date empty
14 Settled date empty
15 Extra optional E
16 Transaction ID optional
17 Account ID optional
18 Note optional
19 Conversion empty
BROKER_INT,2022/09/03 12:40:00,,,USD,36,,,USD,12,,,USA,,,,,,
BROKER_INT_PAID,2022/07/03 12:40:00,,,GBP,2

Equalisation

Equalisation is not a transaction type: it is a component of a fund distribution, entered with the eq= key in the Extra column of the dividend/interest (or notional) row it belongs to — see Column 15: Extra. The amount is a portion of the row's out amount, in the same currency, and the row must carry an ex date. Equalisation against Excess Reportable Income is entered on the reporting fund period instead.


Share Reorganisation

Types: SPLIT, REV_SPLIT, BONUS

# Name Req Notes
0 Type required
1 Date required
2 Base asset required
3 Base quantity required Quantity change. Negative when short
4 Out asset empty
5 Out quantity empty
6 Fees asset empty
7 Fees quantity empty
8 Tax asset empty
9 Tax quantity empty
10 Accrued income asset empty
11 Accrued income quantity empty
12 Tax country empty
13 Ex-date empty
14 Settled date empty
15 Extra required ratio=
16 Transaction ID optional
17 Account ID optional
18 Note optional
19 Conversion empty

Examples

Holding 100 shares of AAPL; after a 2-for-1 split the quantity increases by 100.

SPLIT,2022/06/14 16:00:00,AAPL,100,,,,,,,,,,,,ratio=2:1,,,

Holding 200 shares of AAPL; after a 2-for-1 split the quantity decreases by 100.

REV_SPLIT,2022/06/14 16:00:00,AAPL,100,,,,,,,,,,,,ratio=1:2,,,

Holding 1000 shares of AAPL; after a 5-for-1 bonus issue, the quantity increases by 5000.

BONUS,2022/06/14 16:00:00,AAPL,5000,,,,,,,,,,,,ratio=5:1,,,

Spin Off

Types: SPIN_OFF

The calculation apportions cost between the base asset and the spun off asset using the per-unit market value of the base asset on the transaction date. This value comes from the Valuations section of the app rather than the CSV file: add a valuation for the base asset on the transaction date. If no valuation exists, the transaction is excluded from the calculation and the Tax Issues panel offers an "Add Valuation" fix.

# Name Req Notes
0 Type required
1 Date required
2 Base asset required
3 Base quantity empty
4 Out asset required Spun off asset
5 Out quantity required
6 Fees asset empty
7 Fees quantity empty
8 Tax asset empty
9 Tax quantity empty
10 Accrued income asset empty
11 Accrued income quantity empty
12 Tax country empty
13 Ex-date empty
14 Settled date empty
15 Extra optional E
16 Transaction ID optional
17 Account ID optional
18 Note optional
19 Conversion empty

Examples

Spin off 500 shares of CHILD from SOURCE. The per share value of SOURCE used to apportion cost is taken from SOURCE's valuation on 2022/07/01.

SPIN_OFF,2022/07/01 10:40:06,SOURCE,,CHILD,500,,,,,,,,,,,,,

Rights Take Up

Types: RIGHTS_TAKE_UP

# Name Req Notes
0 Type required
1 Date required
2 Base asset required Asset for which the rights are issued
3 Base quantity required Quantity of new shares issued
4 Out asset required Amount paid to subscribe
5 Out quantity required
6 Fees asset empty
7 Fees quantity empty
8 Tax asset empty
9 Tax quantity empty
10 Accrued income asset empty
11 Accrued income quantity empty
12 Tax country empty
13 Ex-date empty
14 Settled date empty
15 Extra optional E
16 Transaction ID optional
17 Account ID optional
18 Note optional
19 Conversion optional

Examples

Subscribe for 100 new shares of AAPL at a total cost of £500.

RIGHTS_TAKE_UP,2022/07/01,AAPL,100,GBP,500

Capital Distribution

Types: CAP_DIST

Where the distribution is treated as a small disposal or a part disposal, the calculation uses the per-unit market value of the base asset on the transaction date. This value comes from the Valuations section of the app rather than the CSV file: add a valuation for the base asset on the transaction date. If no valuation exists, the transaction is excluded from the calculation and the Tax Issues panel offers an "Add Valuation" fix.

# Name Req Notes
0 Type required
1 Date required
2 Base asset required
3 Base quantity empty
4 Out asset required
5 Out quantity required
6 Fees asset empty
7 Fees quantity empty
8 Tax asset empty
9 Tax quantity empty
10 Accrued income asset empty
11 Accrued income quantity empty
12 Tax country empty
13 Ex-date empty
14 Settled date empty
15 Extra optional E
16 Transaction ID optional
17 Account ID optional
18 Note optional
19 Conversion optional

Examples

£50 capital distribution from AAPL. The per share value of AAPL used for the disposal calculation is taken from AAPL's valuation on 2024/07/15.

CAP_DIST,2024-07-15,AAPL,,GBP,50.00

Withdrawal and Deposits

Types: DEP, WDL

# Name Req Notes
0 Type required
1 Date required
2 Base asset empty
3 Base quantity empty
4 Out asset required
5 Out quantity required
6 Fees asset optional
7 Fees quantity optional
8 Tax asset empty
9 Tax quantity empty
10 Accrued income asset empty
11 Accrued income quantity empty
12 Tax country empty
13 Ex-date empty
14 Settled date empty
15 Extra optional E
16 Transaction ID optional
17 Account ID optional
18 Note optional
19 Conversion optional

Examples

WDL,2022/07/04 12:40:00,,,GBP,200

Fee

Types: FEE, FEE_REFUND

# Name Req Notes
0 Type required
1 Date required
2 Base asset empty
3 Base quantity empty
4 Out asset required
5 Out quantity required
6 Fees asset empty
7 Fees quantity empty
8 Tax asset empty
9 Tax quantity empty
10 Accrued income asset empty
11 Accrued income quantity empty
12 Tax country empty
13 Ex-date empty
14 Settled date empty
15 Extra optional E
16 Transaction ID optional
17 Account ID optional
18 Note optional
19 Conversion optional

Examples

FEE,2022/07/04 12:40:00,,,GBP,2,,,,,,,,,,,,,

Option Exercise and Assignment

Types: OPT_EXERCISE, OPT_ASSIGN

# Name Req Notes
0 Type required
1 Date required
2 Base asset required
3 Base quantity required
4 Out asset required
5 Out quantity required
6 Fees asset optional
7 Fees quantity optional
8 Tax asset optional Transaction tax
9 Tax quantity optional
10 Accrued income asset optional for underlying trade
11 Accrued income quantity optional
12 Tax country empty
13 Ex-date empty
14 Settled date optional required when accrued income exists
15 Extra required u_qty=, E (underlying quantity required)
16 Transaction ID optional
17 Account ID optional
18 Note optional
19 Conversion optional

Examples

OPT_ASSIGN,2022/06/20 13:13:21,MY_OPTION,40,USD,125,USD,1.25,,,,,,,,u_qty=10,,,

Option Cash Excercise and Assignment

Types: OPT_EXERCISE_CASH, OPT_ASSIGN_CASH,

# Name Req Notes
0 Type required
1 Date required
2 Base asset required
3 Base quantity required
4 Out asset required
5 Out quantity required
6 Fees asset optional
7 Fees quantity optional
8 Tax asset optional Transaction tax
9 Tax quantity optional
10 Accrued income asset empty
11 Accrued income quantity empty
12 Tax country empty
13 Ex-date empty
14 Settled date empty
15 Extra optional E
16 Transaction ID optional
17 Account ID optional
18 Note optional
19 Conversion optional

Examples

OPT_ASSIGN_CASH,2022/06/20 13:20:21,MY_OPTION,60,USD,150,USD,1.25,,,,,,,,,,,

Option Expire

Types: OPT_EXPIRE

# Name Req Notes
0 Type required
1 Date required
2 Base asset required
3 Base quantity required
4 Out asset empty
5 Out quantity empty
6 Fees asset empty
7 Fees quantity empty
8 Tax asset empty
9 Tax quantity empty
10 Accrued income asset empty
11 Accrued income quantity empty
12 Tax country empty
13 Ex-date empty
14 Settled date empty
15 Extra optional E
16 Transaction ID optional
17 Account ID optional
18 Note optional
19 Conversion empty

Examples

OPT_EXPIRE,2022/07/01 15:13:21,MY_OPTION,100,,,,,,,,,,,,,,,

Bond Maturity

Types: BOND_MATURITY

# Name Req Notes
0 Type required
1 Date required
2 Base asset required Bond
3 Base quantity required
4 Out asset required Currency
5 Out quantity required Redemption
6 Fees asset empty
7 Fees quantity empty
8 Tax asset empty
9 Tax quantity empty
10 Accrued income asset empty
11 Accrued income quantity empty
12 Tax country empty
13 Ex-date empty
14 Settled date empty
15 Extra empty
16 Transaction ID optional
17 Account ID optional
18 Note optional
19 Conversion optional

Examples

BOND_MATURITY,2023/07/01 16:20:00,ASSET,900,GBP,9200,,,,,,,,,,,,,