This guide explains the LEI code format in plain English. You will see how the 20-character structure works, why the design avoids embedded intelligence, and how check digits help catch errors. As a result, you will read an LEI with confidence and validate it quickly.
LEI code format: quick structure
Figure 1 — The LEI code format has three parts and always totals 20 characters.
In short, the LEI code format follows ISO 17442. Therefore, it uses a fixed 20-character layout: a 4-character issuer prefix, a 14-character entity block, and 2 check digits. Consequently, systems can parse it consistently.
Authoritative reference: see the official explanation of the LEI code structure on the Global Legal Entity Identifier Foundation site. GLEIF — ISO 17442: The LEI code structure
Segment breakdown with examples
1–4: Issuer prefix
This 4-character prefix identifies the accredited LEI issuer (LOU). It ensures global uniqueness across issuers. Moreover, it does not encode geography.
5–18: Entity-specific block
This 14-character block is assigned by the issuer. It contains no embedded intelligence. Hence, it remains opaque and stable.
19–20: Check digits
These two digits are calculated from the first 18 characters. As a result, most common data entry errors are detected early.
Visual example (for reading only)
XXXX XXXXXXXXXXXX CC
Hyphens and spaces above are shown for clarity. However, an actual LEI contains no separators.
Check digits (ISO/IEC 7064 MOD 97-10)
Figure 2 — High-level view of how the two check digits are computed from characters 1–18.
Practically, the algorithm converts letters to numbers, concatenates the result with digits, and applies the ISO/IEC 7064 MOD 97-10 method. Consequently, the last two digits enable robust error detection during onboarding and reporting.
Tip: For production systems, rely on an audited library rather than hand-rolled math. Nevertheless, the flow above helps you understand what is happening.
Character set and case
- Allowed: A–Z and 0–9.
- Not allowed: spaces, hyphens, or special symbols.
- Case: Uppercase is standard; matching should be case-insensitive for user inputs.
Therefore, the LEI code format is easy to capture on forms and simple to validate consistently.
Regex and basic validation
Use a lightweight pattern check first, then perform a check-digit test.
^[A-Z0-9]{18}[0-9]{2}$
Form hint: Accept uppercase automatically and strip whitespace. Then run the MOD 97-10 check to confirm integrity.
Common mistakes to avoid
- Adding separators. Do not insert spaces or dashes for display.
- Assuming country codes. The LEI code format has no embedded geography.
- Skipping renewals. Check digits do not change yearly, yet reference data must stay current.
- Trusting only a regex. Always include a check-digit validation step.
FAQ
Does the LEI encode company details?
No. The string is neutral by design. However, the public LEI record holds the entity’s reference and relationship data.
Can I tell the issuer from the first four characters?
Yes. The prefix identifies the issuer. Nevertheless, you should always verify the full code using the check digits.
Is the LEI code format the same worldwide?
Yes. ISO 17442 defines one global format. Therefore, the structure is consistent across jurisdictions and systems.
One authoritative source used in this article: GLEIF — ISO 17442: The LEI code structure.
Learn more: