MRZ Calculator
Guide · ICAO Doc 9303 · TD3

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.

PositionFieldValueMeaning
1Document typePP denotes a passport (TD3). Some states use P< or PA, PB, PC for sub-types.
2Type sub-code<Filler character or sub-type indicator chosen by the issuing state.
3–5Issuing countryUTOThree-letter ICAO country/organization code identifying the issuing authority.
6–44NameDOE<<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.

PositionFieldValueMeaning
1–9Document numberL898902C3Passport number, up to 9 alphanumeric characters, padded with < if shorter.
10Check digit (doc no.)6Check digit guarding the document number, computed with 7-3-1 weights mod 10.
11–13NationalityUTOThree-letter ICAO nationality code of the holder.
14–19Date of birth740812YYMMDD format. Here: 12 August 1974.
20Check digit (DOB)2Check digit guarding the date of birth.
21SexFM, F, or < for unspecified.
22–27Expiry date120415YYMMDD format. Here: 15 April 2012.
28Check digit (expiry)9Check digit guarding the expiry date.
29–42Optional / personal no.ZE184226B<<<<<Issuer-defined slot, often a personal number. Padded with <.
43Check digit (optional)1Check digit guarding the optional field. Use < if the slot is fully empty.
44Composite check digit0Final 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:

  1. Map each character to a number: 0–9 stay as themselves, A=10 … Z=35, filler < = 0.
  2. Multiply position by position using the repeating weights 7, 3, 1.
  3. Sum the products and take mod 10 — that remainder is the check digit.
Worked example — date of birth 740812
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 letter O look similar — OCR-B keeps them distinct, but typed copies often confuse them.
  • Two-digit years roll over: a date of birth like 050615 means 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.