
ISO 8583 Is Still Everywhere: Parsing the Message That Runs the Rails
Every card authorization that goes online becomes an ISO 8583 message — a four-digit MTI, one or two bitmaps, and a sparse set of data elements. A structural walk through the MTI, the bitmap that tells you which fields are present, the fixed-vs-variable length rule, and the DEs a Staff+ engineer actually meets.
✨TL;DR / Executive Summary
Every card authorization that goes online becomes an ISO 8583 message — a four-digit MTI, one or two bitmaps, and a sparse set of data elements. A structural walk through the MTI, the bitmap that tells you which fields are present, the fixed-vs-variable length rule, and the DEs a Staff+ engineer actually meets.
💡 TL;DR (Too Long; Didn't Read)
ISO 8583 in 90 seconds:
- When a chip transaction goes online, it becomes an ISO 8583 message: a four-digit MTI, a bitmap, and the data elements the bitmap says are present.
- The MTI encodes version, message class (authorization, financial, reversal…), function, and who originated it — four digits that tell you what the message is.
- The primary bitmap is 64 bits; bit n set means "DE n is present." Bit 1 set means a secondary bitmap follows for DEs 65–128. The message is sparse by design.
- Each DE has a defined type and length rule: fixed, LLVAR (2-digit length prefix), or LLLVAR (3-digit). Miss the length rule and you desync the whole parse.
- It is a 1980s protocol still carrying most of the world's card authorizations. You will meet it.
There is a persistent myth that ISO 8583 is legacy in the sense of "gone." It is legacy in the sense of "load-bearing." The overwhelming majority of card authorizations on Earth — every time a terminal goes online for an approval — still traverse an ISO 8583 message at some point between the acquirer and the issuer, even when the edges are dressed up in JSON APIs. If you integrate with an acquiring host, a switch, or an issuer processor, you will parse ISO 8583, and the protocol rewards a clear mental model because its density is deliberate: it was designed when every byte on the wire cost money. This is a structural walk — the MTI, the bitmap, the length rules, and the data elements you actually touch. It follows ISO 8583:1987/1993/2003; the field semantics vary by scheme and network, so treat this as the grammar and your network's spec as the dictionary.
The message in three parts
An ISO 8583 message is, structurally, three things in order: a Message Type Indicator, one or two bitmaps, and a series of data elements. That is the whole shape. Everything hard about ISO 8583 is in the details of each part, not in the arrangement.
The MTI: what kind of message is this
The MTI is four digits, and each digit is a coordinate. The first digit is the version (0 = 1987, 1 = 1993, 2 = 2003, 8 = network-specific). The second is the message class: 1xx authorization, 2xx financial (with a monetary posting), 4xx reversal, 8xx network management, and so on. The third is the function — request, request response, advice, advice response — and the fourth is the origin (acquirer, issuer, other). So an MTI of 0100 reads as: 1987 version, authorization class, request, from the acquirer. Its response is 0110. A 0400 is a reversal request; an 0800 is a network-management message like a sign-on or echo test.
Learn to read the MTI at a glance and you know, before parsing a single field, whether you are looking at an authorization or a reversal, a request or a response, and which side sent it. That framing prevents the classic error of applying authorization logic to a reversal because you did not check the class.
The bitmap: which fields are present
ISO 8583 does not send empty fields. It sends a bitmap — a 64-bit map where bit n being set means "data element n is present in this message." The message then contains exactly those DEs, in ascending order. This is why the protocol is compact: a message that uses fifteen fields carries fifteen fields, not a hundred-and-twenty-eight placeholders.
There is one recursion to internalize. Bit 1 of the primary bitmap is not DE 1 — it is the flag "a secondary bitmap follows." If bit 1 is set, the next 64 bits are the secondary bitmap covering DEs 65 through 128. So the parse is: read the primary bitmap; if its top bit is set, read the secondary bitmap; then walk the combined bits in order, and for each set bit, read that DE according to its type. Bitmaps are usually transmitted as hex (8 bytes each). A primary bitmap of 7220000000000000 has bits 2, 3, 4, 7, 11, 12… set — decode it and you have the message's field list before you read a single value.
Fixed, LLVAR, LLLVAR: the length rule that keeps you in sync
Each data element has a defined format and length discipline, and getting it wrong is how parsers desynchronize. Three length forms cover most fields:
- Fixed — the field is exactly N characters/digits, no length prefix. DE 3 (processing code) is a fixed 6 digits; DE 11 (STAN) is a fixed 6.
- LLVAR — a 2-digit length prefix gives the field's length, then that many characters follow. Used for fields that vary but stay under 100 long, like DE 2 (PAN):
LLsays how many PAN digits follow. - LLLVAR — a 3-digit length prefix, for fields up to 999 long. DE 55 (ICC data) is LLLVAR because the EMV tag soup inside it can be large.
The failure mode is unforgiving: read an LLVAR field as fixed, or misread its length prefix, and every byte after it shifts — you will parse the next field's data as a length, get a nonsensical count, and produce garbage that looks structured. A robust parser is table-driven: a per-DE definition of type, length form, and max length, applied in bitmap order. Do not hand-roll the offsets.
The data elements you actually meet
There are 128 possible DEs; you will regularly touch maybe two dozen. The ones worth knowing by number:
- DE 2 — Primary Account Number (LLVAR).
- DE 3 — Processing Code (6 digits: transaction type + account types).
- DE 4 — Amount, transaction (fixed 12, minor units).
- DE 7 — Transmission date and time.
- DE 11 — System Trace Audit Number (STAN) — the per-message trace id.
- DE 12 / 13 — local transaction time / date.
- DE 22 — POS entry mode (how the PAN was captured: chip, contactless, swipe, keyed).
- DE 24 — function code / network international identifier.
- DE 25 — POS condition code.
- DE 35 — Track 2 data (LLVAR) — the field from the Track 2 article.
- DE 37 — Retrieval Reference Number (RRN).
- DE 38 — authorization identification response (the approval code).
- DE 39 — response code (the approve/decline result —
00is approved). - DE 41 / 42 — card acceptor (terminal) ID / merchant ID.
- DE 49 — transaction currency code (ISO 4217).
- DE 52 — PIN data (the PIN block).
- DE 55 — ICC data (the EMV bridge, LLLVAR).
- DE 64 / 128 — Message Authentication Code.
Read a message and the story is right there: DE 2 who, DE 4 how much, DE 49 in what currency, DE 22 how it was captured, DE 39 what the issuer said, DE 55 the chip's cryptographic proof.
Battle scars
The response echoes, then differs. A 0110 response mirrors many of the 0100 request's fields — STAN, RRN, amount — which is how you correlate them. But it adds the answer: DE 39 (response code) and DE 38 (auth code). Matching a response to its request on STAN + terminal is the backbone of any reconciliation, and a duplicated STAN is the backbone of any dispute.
Bitmap bit 1 is the recursion, not a field. The single most common first-parse bug is treating the top bit of the primary bitmap as "DE 1 present" and then reading the secondary bitmap's 8 bytes as field data. If your first data element comes out as nonsense, check whether you consumed the secondary bitmap.
Amounts are in minor units with no decimal. DE 4 carries the amount as an integer in the currency's minor unit — 000000010000 with DE 49 = 986 (BRL) is 100.00 reais, not 10000. The exponent lives in the currency table, not in the message. Divide by the wrong power of ten and you are off by orders of magnitude in the one field nobody forgives you for.
Where this fits
ISO 8583 is the envelope the online path of the transaction flow travels in — it carries the Track 2 data (DE 35), the PIN block (DE 52), and, crucially, the EMV cryptogram and its supporting tags (DE 55). The gsstk ISO 8583 Parser turns a raw message into MTI + bitmap + decoded DEs so you can stop counting length prefixes by hand.
Related Reading on gsstk
- Field 55: The EMV Bridge Inside ISO 8583 — the chip data that rides in DE 55.
- Track 2 and the Service Code — what travels as DE 35.
- PIN Blocks Explained: ISO 9564 Formats 0 to 4 — what travels as DE 52.
Tools: parse a message with the ISO 8583 Parser; decode DE 55's EMV tags in the EMV Tag Dictionary.
Filed under: ISO 8583 · Payments · Acquiring · EMV
This article was human-architected and synthesized with AI assistance under the Hephaestus (AI) persona.