How to Read a Passport MRZ
The two-line strip at the bottom of a passport's photo page is the Machine Readable Zone (MRZ). On a passport booklet it follows the TD3 layout — two lines of exactly 44 characters each, printed in OCR-B. This guide walks through every character position so you can decode any passport MRZ by hand.
Sample TD3 passport MRZ
P<UTODOE<<JANE<MARIE<<<<<<<<<<<<<<<<<<<<<<<< L898902C36UTO7408122F1204159ZE184226B<<<<<10
Two lines · 44 characters each · 88 characters total. The filler character < pads unused slots so every field sits in a fixed position a scanner can rely on.
Line 1 — document type, country & name
Positions 1–5 identify what the document is and who issued it. Positions 6–44 carry the holder's name in the order surname, given names.
| Position | Field | Value | Meaning |
|---|---|---|---|
| 1 | Document type | P | P denotes a passport (TD3). Some states use P< or PA, PB, PC for sub-types. |
| 2 | Type sub-code | < | Filler character or sub-type indicator chosen by the issuing state. |
| 3–5 | Issuing country | UTO | Three-letter ICAO country/organization code identifying the issuing authority. |
| 6–44 | Name | DOE<<JANE<MARIE<<… | Surname first, then << separator, then given names separated by single <. Padded with < to fill 39 characters. |
Line 2 — document number, dates & check digits
The second line is where every passport-validation system focuses. It encodes the passport number, the holder's nationality, two dates, the optional personal-number slot, and five check digits.
| Position | Field | Value | Meaning |
|---|---|---|---|
| 1–9 | Document number | L898902C3 | Passport number, up to 9 alphanumeric characters, padded with < if shorter. |
| 10 | Check digit (doc no.) | 6 | Check digit guarding the document number, computed with 7-3-1 weights mod 10. |
| 11–13 | Nationality | UTO | Three-letter ICAO nationality code of the holder. |
| 14–19 | Date of birth | 740812 | YYMMDD format. Here: 12 August 1974. |
| 20 | Check digit (DOB) | 2 | Check digit guarding the date of birth. |
| 21 | Sex | F | M, F, or < for unspecified. |
| 22–27 | Expiry date | 120415 | YYMMDD format. Here: 15 April 2012. |
| 28 | Check digit (expiry) | 9 | Check digit guarding the expiry date. |
| 29–42 | Optional / personal no. | ZE184226B<<<<< | Issuer-defined slot, often a personal number. Padded with <. |
| 43 | Check digit (optional) | 1 | Check digit guarding the optional field. Use < if the slot is fully empty. |
| 44 | Composite check digit | 0 | Final check digit covering document number + DOB + expiry + optional data and their check digits. |
How the check digits work
Every check digit in a passport MRZ is calculated the same way — the 7-3-1 weight algorithm defined in ICAO Doc 9303:
- Map each character to a number:
0–9stay as themselves,A=10 … Z=35, filler<=0. - Multiply position by position using the repeating weights
7, 3, 1. - Sum the products and take
mod 10— that remainder is the check digit.
Input: 7 4 0 8 1 2 Weights: 7 3 1 7 3 1 Products: 49 12 0 56 3 2 → sum = 122 122 mod 10 = 2 → check digit = 2
The final character on line 2 — the composite check digit — is computed over the document number, date of birth, expiry date, optional data, and their individual check digits. If any field has been altered, the composite digit will no longer match.
Common gotchas when reading a passport MRZ
- The character
0(zero) and the letterOlook similar — OCR-B keeps them distinct, but typed copies often confuse them. - Two-digit years roll over: a date of birth like
050615means 15 June 2005, not 1905. ICAO uses a sliding window relative to today. - Names longer than the 39-character name field are truncated. The MRZ is not a source of truth for full legal names.
- Empty optional data is filled entirely with
<and its check digit becomes<as well. - Some passports print the document number with embedded
<when the real number is longer than 9 characters — the extra digits move into the optional field.
Decode your own passport MRZ
Paste the two lines into the validator to see every field parsed, every check digit verified, and any errors highlighted.