Guides / MT940

MT940 explained: the :61: and :86: lines

MT940 is the SWIFT text format for a bank statement. Each transaction is a :61: line (dates, a debit or credit mark, the amount, a type and references) followed by an :86: line (free-text details, laid out differently by each bank). Milyo's free matcher reads both in your browser and turns each :61: and its :86: into one row.

Published 2026-11-19. Everything about Milyo on this page is true of the code in the repository on that date.

A small statement

This statement is made up. It has one credit from Stripe and one reversed debit.

:20:940S261231
:25:NL91ABNA0417164300
:28C:1/1
:60F:C261231EUR500,00
:61:2612310102C1799,55NTRFEREF//ABCDE99999
:86:/EREF/po_1Q8xLm/REMI/USTD//Stripe payout po_1Q8xLm/NAME/STRIPE PA
YMENTS UK LTD/
:61:261231RD20,00NMSCNONREF
:86:Reversal card fee
:62F:C261231EUR2319,55

Every line starts with a tag between colons. A line that does not start with a colon continues the line before it. That is why the Stripe name above runs onto a second line.

The tags Milyo reads

TagWhat it holdsWhat Milyo does with it
:20:Statement reference. Starts a statement.Starts a new statement. A file with no :20: is rejected.
:25:Account, often an IBAN.The account column.
:28C:Statement and sequence number.The statement column.
:60F:, :60M:Opening balance: a C or D mark, a date, a currency, an amount.Takes the currency from it. Every line below uses that currency. The amount is not read.
:61:One statement line: one transaction.One row.
:86:Details for the :61: just above it.Fills that row's references, text and name.
:62F:, :62M:Closing balance.Ends the statement's lines. The amount is not read.

Other tags, such as :64: and :65:, are skipped. An :86: that comes after the closing balance is a note about the whole statement, so Milyo ignores it. Milyo does not check that the lines add up to the closing balance.

The :61: line, part by part

Take the first line from the statement above: :61:2612310102C1799,55NTRFEREF//ABCDE99999

PartExampleMeaning
Value date261231YYMMDD: 31 December 2026. Milyo reads the year as 20yy.
Entry date0102MMDD, optional. The day the bank booked it: 2 January. It has no year, so Milyo takes the value date's year, and moves it to the next year when a December value date has a January entry date. Here, 2027-01-02. The reverse (January value, December entry) moves it back a year. With no entry date, the value date is used.
MarkCC, D, RC or RD. See below. One extra letter after it, the funds code, is allowed and ignored.
Amount1799,55A comma for the decimal mark. 980, means 980 with no decimals. Milyo writes it with a dot.
TypeNTRFN, S or F, then a three-letter code: TRF for a transfer, MSC for miscellaneous, CHG for charges.
Customer referenceEREFUp to 16 characters. NONREF means the bank had none.
Bank referenceABCDE99999After //, optional.
SupplementaryAn optional second line of up to 34 characters. Milyo keeps it in the supplementary column.

Sign: C, D, RC and RD

The amount in a :61: line has no sign. The mark gives it one.

MarkMeaningMilyo's amount
CCredit: money in.Positive
DDebit: money out.Negative
RCReversal of a credit: a credit that is taken back.Negative
RDReversal of a debit: a debit that is given back.Positive

In the small statement, RD20,00 becomes 20.00: money back. The credit_debit column keeps the mark as written, so you can still tell a reversal from a plain credit.

The :86: line has no single layout

SWIFT says :86: holds free text. Each bank fills it in its own way. Milyo reads the two layouts we have test files for, and falls back to the text itself.

German banks: ?nn subfields

The text starts with a posting-text code, then subfields marked ?00 to ?99. Here is an example, with the line wrapped as banks do:

:86:177?00SEPA-UEBERWEISUNG?20EREF+INV-2291?21SVWZ+Rechnung 2291 Ok
?22tober?32ACME Hosting Gm?33bH
SubfieldsHoldsMilyo's column
?20 to ?29, ?60 to ?63The payment text, cut into 27-character pieces.Joined with no spaces, because the cuts fall inside words ("Ok" + "tober"). Then split on keywords.
EREF+ inside the textThe end-to-end id.end_to_end_id: INV-2291
SVWZ+ inside the textThe payment text for the payer.remittance: Rechnung 2291 Oktober. With no SVWZ+, the whole text.
?32, ?33The other party's name.counterparty: ACME Hosting GmbH

The other keywords (KREF+, MREF+, CRED+, ABWA+, ABWE+, DEBT+) mark where a value ends, but get no column of their own. Neither do the posting text in ?00 or the bank code and account in ?30 and ?31. All of it stays, unparsed, in the details column.

Dutch banks: slash codes

The text is a run of /CODE/value pairs, as in the small statement:

/EREF/po_1Q8xLm/REMI/USTD//Stripe payout po_1Q8xLm/NAME/STRIPE PAYMENTS UK LTD/

Only a fixed list of codes splits the text: EREF, CREF, PREF, IREF, REMI, NAME, BIC, IBAN, CSID, MARF, TRTP, ULTC, ULTD, TRCD, ORDP, BENM, CNTP, PURP, RTRN and ADDR. Only three of them get columns. A slash inside a value, as in Fee refund INV/2311, therefore stays whole.

Anything else

If the :86: text is neither layout, Milyo puts all of it in remittance and details.

What the file may look like

The columns Milyo produces

One row per :61:: statement, account, value_date, booking_date, amount, currency, credit_debit, transaction_type, customer_ref, bank_ref, end_to_end_id, remittance, counterparty, supplementary and details. Dates are YYYY-MM-DD. Amounts are signed decimals with a dot.

Read it in the free matcher

  1. Open try.milyo.app and drop the statement on File A or File B. Nothing is uploaded: the page's security policy only lets it talk to its own address.
  2. Go to Map columns. You see the entry count and the first 20 entries, with the columns above.
  3. Milyo suggests the mapping: Transaction ID from bank_ref, Date from booking_date, Reference from remittance, plus amount, currency and counterparty. MT940 holds booked entries only, so there is no status filter.

To match on the end-to-end id, for example a Stripe payout id from /EREF/, set Reference to end_to_end_id in the mapping step. The key pass compares whole values, so the id must be the whole value.

Use the free converter

To get the whole statement as a CSV, open try.milyo.app/mt940-to-csv, drop the file and choose "Download CSV". You get one row per :61: line with the columns above, in your browser, with nothing uploaded. The matcher can also download the statement: drop it, then choose "Download as CSV".

Have a statement and a ledger to compare? Load both. No account. Your files stay in your browser.

Open the free matcher

Related guides