Appearance
Understanding the MRZ
The Machine Readable Zone (MRZ) is the block of OCR-B text on the data page of a passport or identity card, defined in ICAO Doc9303 (Parts 3-7). It is central to both KINEGRAM product lines: the MOBILE SCAN SDK reads it optically, and the MOBILE CHIP SDK uses it as the access key to the eMRTD chip.
MRZ Formats
| Format | Layout | Typical Documents |
|---|---|---|
TD1 | 3 lines × 30 chars | Identity cards (credit card size) |
TD2 | 2 lines × 36 chars | Older/smaller ID documents |
TD3 | 2 lines × 44 chars | Passports |
MRV-A | 2 lines × 44 chars | Visas (full size) |
MRV-B | 2 lines × 36 chars | Visas (smaller format) |
All formats carry the same core fields, arranged differently:
- Document code (for example
P<for passport,I<for ID card) - Issuing state (3-letter code)
- Name (primary and secondary identifier, separated by
<<) - Document number
- Nationality
- Date of birth
- Sex
- Date of expiry
- Optional data (used by some states for a personal number)
The filler character < pads unused positions.
Dates are encoded as YYMMDD, without a century. Converting such a date into a real date requires a windowing rule based on the field: in the specimen below, the date of birth 690806 is 6 August 1969, while the same digits in a date of expiry would mean 2069.
Anatomy of a Passport MRZ
The two lines below are the ICAO Doc9303 specimen for a TD3 passport. The first line holds the document type, the issuing state and the name. The second line packs the document number, the key dates and their check digits into fixed positions:
text
P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<
L898902C<3UTO6908061F9406236ZE184226B<<<<<14The second line is where the fixed-position layout matters most. Each field occupies a fixed range of characters:
L898902C<Document number3CDUTONationality690806Date of birth1CDFSex940623Date of expiry6CDZE184226B<<<<<Personal number1CD4CCHere CD marks a field check digit and CC the composite check digit that covers the whole line. The filler < pads each field to its fixed length. This is why the short document number L898902C is followed by one < before its check digit 3.
Document numbers longer than 9 characters do not fit the TD3 field at all. Positions 1-9 then hold the first 9 characters, and the check digit position holds a filler <. The remaining characters are placed at the start of the optional data field, followed by the check digit over the complete document number. The Access Key has to be derived from the complete document number. This makes such documents a frequent cause of failed chip access.
Check Digits
Several fields carry a check digit so that reading errors can be detected. The check digit is calculated with a repeating 7-3-1 weighting:
- Map each character to a value: digits keep their value,
A-Zmap to10-35, the filler<maps to0. - Multiply the values by the repeating weights
7, 3, 1, 7, 3, 1, …. - Add up the products. The check digit is that sum modulo
10.
For example, the document number L898902C from the specimen above produces the check digit 3:
| Character | L | 8 | 9 | 8 | 9 | 0 | 2 | C |
|---|---|---|---|---|---|---|---|---|
| Value | 21 | 8 | 9 | 8 | 9 | 0 | 2 | 12 |
| Weight | 7 | 3 | 1 | 7 | 3 | 1 | 7 | 3 |
| Product | 147 | 24 | 9 | 56 | 27 | 0 | 14 | 36 |
The products sum to 313, and 313 mod 10 = 3, so the field is stored as L898902C3.
Check digits protect the document number, the date of birth, the date of expiry and, on TD3, the optional data field. Some of these fields may contain letters as well as digits. This is why the mapping above covers A-Z. A final composite check digit covers those fields together, including their individual check digits, so typical OCR errors are detected.
Why the MRZ Is the Key to the Chip
The Access Control protocols BAC and PACE derive their Access Key from the MRZ Info: document number, date of birth and date of expiry, each including its check digit.
This is the reason for the typical two-step flow of the KINEGRAM products:
- Scan the data page with the MOBILE SCAN SDK to obtain the MRZ.
- Read the chip via NFC with the MOBILE CHIP SDK, using the MRZ Info (or alternatively the printed 6-digit CAN, if the document supports PACE) as the access key.
Notes:
- Pass the document number as printed, without the filler
<. For the specimen above this isL898902C, notL898902C<. Both forms are accepted, because the SDKs pad the value to the width of the MRZ field themselves. The printed form is the one to prefer. Document numbers longer than 9 characters are passed in full. - Without a correct MRZ (or CAN) the chip cannot be read at all. This is the skimming protection of the eMRTD.
- The chip stores a copy of the MRZ in Data Group 1, verified by Passive Authentication. Comparing the optically scanned MRZ with Data Group 1 detects manipulated data pages, see Interpreting Verification Results.
