ISO 8583
The foundational financial transaction message standard used by ATMs, POS terminals, card switches, and payment gateways worldwide. Every card payment you make passes through this protocol.
Message Structure
Every ISO 8583 message has three mandatory components: the Message Type Indicator (MTI), the bitmap, and the data elements. The bitmap acts as a presence map indicating which data elements follow.
Message Type Indicator (MTI)
The MTI is a 4-digit numeric field that uniquely identifies each message. Each digit carries distinct meaning:
| Position | Meaning | Values |
|---|---|---|
| 1st digit | ISO version | 0=1987, 1=1993, 2=2003 |
| 2nd digit | Message class | 1=Auth, 2=Financial, 4=Reversal, 5=Recon, 8=Network mgmt |
| 3rd digit | Message function | 0=Request, 1=Response, 2=Advice, 3=Advice response, 4=Notification |
| 4th digit | Message origin | 0=Acquirer, 1=Acquirer repeat, 2=Issuer, 3=Issuer repeat, 4=Other |
Example: MTI 0200 decoded
Result: Financial transaction request from acquirer (e.g., ATM cash withdrawal or PIN-based debit purchase)
Bitmap
The bitmap is a binary field where each bit position N indicates whether Data Element N is present in the message. The primary bitmap covers DE1 through DE64. Bit 1 set means a secondary bitmap follows, covering DE65 through DE128.
Reading bitmaps: Convert each byte to binary. A
1 bit means the corresponding DE is present. DEs follow in ascending numerical order. Bitmap example
Primary bitmap: F2 30 00 01 02 20 00 04
Binary: 1111 0010 0011 0000 0000 0000 0000 0001 ...
Present: DE1 (secondary bitmap), DE2, DE3, DE4, DE7, DE11, DE12, DE25, DE32...
Data Element Formats
| Format | Abbrev | Description |
|---|---|---|
| Numeric | n | BCD or ASCII numeric characters (0-9) |
| Alphabetic | a | ASCII alpha characters (A-Z, a-z) |
| Alphanumeric | ans | ASCII printable characters including special |
| Binary | b | Raw binary data (e.g., bitmaps, cryptograms) |
| Fixed length | (no prefix) | Field is always exactly N characters |
| LLVAR | LL | 2-digit length prefix followed by up to 99 chars |
| LLLVAR | LLL | 3-digit length prefix followed by up to 999 chars |