Guides / CAMT.053 to CSV
CAMT.053 to CSV: which XML fields become which columns
CAMT.053 is the ISO 20022 bank statement in XML. To turn it into CSV, write one row for each <Ntry> (entry): its dates, its amount (negative when it is a debit), the currency, the status, the references and the remittance text. Milyo's free converter does exactly that in your browser: drop the file, download the CSV. Nothing is uploaded.
The fields that matter
A statement holds one or more <Stmt> blocks. Each holds <Ntry> entries. This is what Milyo reads from each entry, and the column it becomes.
| CSV column | XML element | Notes |
|---|---|---|
entry_ref | NtryRef | Often empty. Banks do not all fill it. |
booking_date | BookgDt/Dt | Or BookgDt/DtTm: Milyo keeps the first 10 characters, the bank's own date, with no time-zone shift. |
value_date | ValDt/Dt | Same rule as above. |
amount | Amt | Signed. A DBIT entry gets a minus sign. The XML amount is always positive. |
currency | Amt/@Ccy | Three letters, such as EUR. |
credit_debit | CdtDbtInd | CRDT (money in) or DBIT (money out). |
status | Sts (.02) or Sts/Cd (.08) | BOOK is booked. See the next section. |
bank_ref | AcctSvcrRef | The bank's own reference for the entry. |
end_to_end_id | NtryDtls/TxDtls/Refs/EndToEndId | The id the payer's system sent. For a Stripe payout, this is where a payout id may appear. |
remittance | RmtInf/Ustrd | Free text. If there are several Ustrd lines, they are joined with a space. |
counterparty | RltdPties/Dbtr/Nm for a credit, Cdtr/Nm for a debit | The other party: the payer when money comes in, the payee when it goes out. In .08 the name is nested: Dbtr/Pty/Nm. |
additional_info | AddtlNtryInf | Free text from the bank. |
One entry, one row
This entry is from the sample statement on the free matcher. The data is made up.
<Ntry>
<NtryRef>2</NtryRef>
<Amt Ccy="EUR">2400.00</Amt>
<CdtDbtInd>CRDT</CdtDbtInd>
<Sts>BOOK</Sts>
<BookgDt><Dt>2026-11-02</Dt></BookgDt>
<ValDt><Dt>2026-11-02</Dt></ValDt>
<AcctSvcrRef>2026113000002</AcctSvcrRef>
<NtryDtls><TxDtls>
<RltdPties><Dbtr><Nm>KESTREL FOODS GMBH</Nm></Dbtr></RltdPties>
<RmtInf><Ustrd>INV-2271</Ustrd></RmtInf>
</TxDtls></NtryDtls>
</Ntry>
It becomes this row, in the column order of the table above:
2,2026-11-02,2026-11-02,2400.00,EUR,CRDT,BOOK,2026113000002,,INV-2271,KESTREL FOODS GMBH,
The same entry as a DBIT would have the amount -2400.00 and the payee's name in the counterparty column.
Booked and pending entries
Each entry has a status. BOOK means the bank has booked it: the money has moved. Other statuses, such as PDNG (pending) and INFO (information only), are not money that moved yet.
Milyo's free matcher keeps only BOOK entries by default. The mapping step says "Only rows where status is BOOK", and a link, "Include all rows", turns the filter off. After you apply the mapping it tells you how many entries the filter left out. A pending entry is not final, so matching it could give you a match against money that has not moved.
In a CSV you write yourself, keep the status column and filter on it. Do not drop it.
Which versions Milyo reads
CAMT.053 comes in versions, written as camt.053.001.02, camt.053.001.08 and so on. Milyo's tests read two layouts, and both pass:
- camt.053.001.02. The status is plain text,
<Sts>BOOK</Sts>. Party names sit directly underDbtrandCdtr. - camt.053.001.08. The status is a code,
<Sts><Cd>BOOK</Cd></Sts>. Party names are one level deeper, underPty.
Milyo ignores XML namespaces and looks for the element names above. A version in between, such as .04, should read if it uses the same element names, but we have not tested it, so we do not claim it. If Milyo cannot find a BkToCstmrStmt/Stmt element, it says so and stops.
What Milyo does not read
- Several transactions in one entry. Some banks batch many payments into one
<Ntry>, with a<TxDtls>for each. Milyo reads only the firstTxDtls. The entry's amount is still the full amount. - Structured remittance (
RmtInf/Strd). Only the free-textUstrdlines are read. - Balances (
Bal) and the reversal flag (RvslInd).
Read it in your browser
- Open try.milyo.app and drop the
.xmlfile on File A or File B. Nothing is uploaded: the page's security policy only lets it talk to its own address. - Go to Map columns. You see the file's row count and its first 20 rows, with the columns in the table above.
- Milyo suggests the mapping for you: Transaction ID from
bank_ref, Date frombooking_date, Reference fromremittance, and the amount, currency and counterparty. Change any of them, then apply the mapping.
The matcher also lets you download the statement as a CSV: drop the file, then choose "Download as CSV".
Use the free converter
To get the CSV without matching anything, open try.milyo.app/camt053-to-csv, drop the .xml file and choose "Download CSV". You get one row per entry with the columns in the table above, in your browser, with nothing uploaded. Every entry is written, booked or not, with its status in a column.
A script for automation
If you convert statements on a schedule or in bulk, a script fits better than a web page. This is plain Python, with no packages to install. It writes the main columns from the table, for every entry, with the sign applied. It does not filter on status, so filter BOOK yourself. It is simpler than Milyo: it joins the remittance text of all transactions in an entry, where Milyo reads the first. We ran it on our .02 and .08 test files and on the sample statement. Run it as python3 camt2csv.py statement.xml > statement.csv.
import csv
import sys
import xml.etree.ElementTree as ET
def local(tag): # drop the {namespace} part, so every version reads the same
return tag.rsplit("}", 1)[-1]
def text_at(el, *path): # text of the first element down this path, or ""
for name in path:
el = next((c for c in el if local(c.tag) == name), None)
if el is None:
return ""
return (el.text or "").strip()
def day(el, name): # YYYY-MM-DD from <Dt> or from the date part of <DtTm>
return text_at(el, name, "Dt") or text_at(el, name, "DtTm")[:10]
def first(el, name): # first descendant with this name, or None
return next((e for e in el.iter() if local(e.tag) == name), None)
out = csv.writer(sys.stdout)
out.writerow(["booking_date", "value_date", "amount", "currency", "status", "bank_ref", "end_to_end_id", "remittance"])
for ntry in ET.parse(sys.argv[1]).getroot().iter():
if local(ntry.tag) != "Ntry":
continue
amt = first(ntry, "Amt")
sign = "-" if text_at(ntry, "CdtDbtInd") == "DBIT" else ""
status = text_at(ntry, "Sts", "Cd") or text_at(ntry, "Sts") # .08 nests the code in <Cd>
e2e = first(ntry, "EndToEndId")
out.writerow([
day(ntry, "BookgDt"), day(ntry, "ValDt"), sign + amt.text.strip(), amt.get("Ccy"),
status, text_at(ntry, "AcctSvcrRef"), e2e.text if e2e is not None else "",
" ".join(e.text for e in ntry.iter() if local(e.tag) == "Ustrd"),
])
The amounts use a dot as the decimal mark. If your spreadsheet expects a comma, set the column's format when you import it.
Have a statement and a ledger to compare? Load both. No account. Your files stay in your browser.
Open the free matcherRelated guides
- MT940 explained: the :61: and :86: lines, the older SWIFT statement format.
- How to reconcile Stripe payouts with a bank statement