What the MRZ is and why a passport can be read in seconds
· 3 min read
At the bottom of every passport data page there are two lines of capital letters, digits and < signs. Most travellers never look at them, and a border officer's scanner starts with them. Those lines are the machine readable zone, or MRZ, and they are the reason a passport can be read by a camera in a couple of seconds.
A standard, not a design choice
The layout comes from ICAO Doc 9303, the specification that the International Civil Aviation Organization publishes for travel documents. A passport from Norway and a passport from Argentina look nothing alike in the printed part of the page, but their bottom two lines follow the same rules.
A passport uses the format called TD3: two lines of 44 characters each. ID cards use other sizes, such as three lines of 30 characters. The zone uses only the letters A to Z, the digits 0 to 9 and the filler character <, printed in a typeface designed for machines, OCR-B.
Reading the two lines
Here is the zone of a fictional specimen, the kind ICAO uses in its own examples:
P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<
L898902C36UTO7408122F3404148ZE184226B<<<<<12
The first line starts with P for passport. The next three letters are the issuing country, here the imaginary state of Utopia. Then comes the name: the surname, a double <<, and the given names separated by single <. The rest of the line is padding.
The second line holds the rest of the data in fixed positions:
L898902C3is the passport number, followed by a check digit,6UTOis the nationality740812is the date of birth as year, month and day, followed by its check digit,2Fis the sex340414is the expiration date, followed by its check digit,8- the remaining characters are an optional personal number and two more check digits
Dates carry only two digits for the year. Software decides the century from context: a date of birth cannot be in the future, and a passport does not stay valid for decades.
How the check digits work
Each check digit is computed from the characters before it. Take the characters one by one and multiply them by the weights 7, 3, 1, repeating. Digits count as themselves, letters count from A = 10 to Z = 35, and < counts as zero. Add everything up and keep the last digit of the sum.
For the date of birth 740812:
7×7 + 4×3 + 0×1 + 8×7 + 1×3 + 2×1 = 122 → check digit 2
If a camera misreads the 8 as a 3, the sum no longer ends in 2 and the software knows that this field is wrong. A reader that verifies the digits can tell a clean read from a doubtful one, which a person retyping the page cannot do without proofreading every character.
What the MRZ does not contain
The zone has no place of birth and no issue date. Those two fields exist only in the printed part of the page, where every country has its own layout, labels and languages. A program has to find them by position and by keywords, and it gets them wrong more often than anything that comes from the zone.
Names are also flattened. The zone has no accents and no characters outside A to Z, so MÜLLER is typically written MUELLER, and long names are cut off at the end of the line. The printed part of the page shows the name the way its owner writes it.
Why lighting matters more than resolution
A phone camera has far more resolution than the zone needs. Failed reads usually come from glare on the laminate, a shadow across the bottom of the page, a thumb over the last characters, or a page that curves away from the lens. Hold the passport flat, keep the whole page in the frame and tilt it until the reflection moves off the two lines.
What ScanPass does with it
ScanPass reads the whole data page with the iPhone's built in text recognition, parses the zone, verifies the check digits and then looks for the place of birth and the issue date in the printed part. It shows you the result to review before anything goes into a list, because the fields outside the zone deserve a second look.