ISO 8583 Parser
Free Β· Reference Β· ~6 min read Β· Updated 2026-08-12

BIN / IIN in ISO 8583: Reading DE 2 and the 8-Digit Migration

The BIN β€” formally the IIN, Issuer Identification Number β€” is the first 6–8 digits of a card number, and it identifies the issuer. In an ISO 8583 message that means the leading digits of DE 2, the PAN. The wire format is the easy part: the ISO/IEC 7812 move from 6-digit to 8-digit IINs changed nothing in the bytes and plenty in the systems that key on them β€” and when DE 2 parsing goes wrong, the damage has a recognizable shape in logs.
On this page: Where is the BIN in DE 2? Β· What the 6 β†’ 8 digit move changes Β· What the BIN controls Β· How to spot DE 2 problems in logs

Where is the BIN in DE 2, and is the IIN the same thing?

DE 2 carries the PAN and is a variable-length field, n ..19 β€” a 2-digit length prefix (LLVAR) followed by up to 19 digits. (If the dot notation is new to you, see how to read field format notation.) On the wire, using a synthetic test number β€” the length prefix is shown separated for clarity:

16 4000001234567899
BytesMeaning
16LLVAR length prefix β€” 16 digits of PAN follow
40000012The IIN / BIN β€” up to the first 8 digits identify the issuer
3456789Individual account number, assigned by the issuer
9Luhn check digit

Terminology first, because the two names cause real confusion in spec reviews: ISO/IEC 7812 calls this prefix the IIN (Issuer Identification Number). BIN (Bank Identification Number) is the older industry name for the same digits. Scheme manuals, processor docs and BIN files use them interchangeably; when a document mixes both, it is not describing two different things.

The very first digit of the IIN is the MII (Major Industry Identifier), which tells you what kind of institution issued the card:

MII digitIndustry
1, 2Airlines
3Travel and entertainment (Amex, JCB, Diners live here)
4, 5Banking and financial (Visa, Mastercard)
6Merchandising and banking/financial (UnionPay lives here)
7Petroleum
8Healthcare and telecommunications
9Assigned by national standards bodies

In the field reference, DE 2 is one line: n ..19, primary account number. Everything this article discusses happens inside the first 8 of those digits.

What actually changes when the BIN goes from 6 to 8 digits?

ISO/IEC 7812 originally defined the IIN as 6 digits. The 2017 revision expanded it to 8 digits because the 6-digit space was running out, and the card networks required issuers, acquirers and processors to handle 8-digit IINs from April 2022. Both lengths are in circulation today.

What does not change: the PAN itself. It is still 13–19 digits, DE 2 is still n ..19, and the bytes on the wire are byte-for-byte identical. A parser that reads DE 2 by its LLVAR prefix needs no change at all. What moves is a boundary that exists only in your business logic: which of those digits belong to the issuer identifier.

What has to change is everything that treats the prefix as a key:

The classic failure mode is code that still slices 6 digits. Under a single 6-digit prefix there can now be different issuers and different card products. Two synthetic examples: 40000012… and 40000013… share the 6-digit prefix 400000 but may belong to entirely different institutions. Nothing throws β€” the message parses, a route is found, a fee program is applied β€” but the transaction lands in the wrong bucket: wrong issuer attribution, wrong interchange qualification, wrong product flags, wrong risk profile. It is a silent-wrong-answer bug, which is why it survives testing.

Finding one usually means looking at real DE 2 values from production, because test ranges almost never put two issuers under the same six digits. Those messages parse in your browser here and go nowhere β€” though if live PANs are not allowed near a website at all, the offline edition does the same job with no network involved.

Rule: parse DE 2 by its length prefix, but key every business decision on up to 8 digits with longest-prefix matching. Issuer-level BIN data is licensed β€” in production it comes from the BIN files your scheme or processor distributes, not from public lists.

What does the BIN control in a live transaction?

How do I spot a DE 2 parsing problem in the logs?

Because DE 2 is usually the first variable-length field in the message, a length mistake here corrupts everything after it. Patterns to recognize:

The fastest way to confirm any of these is to look at a message where DE 2 is known-good. This synthetic authorization (same one used in the annotated message examples) carries 16 + 4000001234567899 in DE 2 and the matching PAN in DE 35:

0100723C448028C08000164000001234567899000000000000005000081009302100012309302108102812541190200334000001234567899=2812101123450000622209000123TERM0001TESTMERCH000001840

Open this message in the parser β†’

Remember: BIN and IIN are the same thing β€” up to the first 8 digits of DE 2. The wire format didn't change in the 8-digit migration; your keys, tables and prefix rules did.

Read next