What is the MRZ on a passport, and what can someone read from a photo of it?
The two lines of letters and < signs at the bottom of a passport page hold your name, number and dates. How a check digit works, with a worked example.
Look at the bottom of your passport's photo page. Under the printed fields are two lines of capital letters, digits and many "<" signs. They look like noise. Machines read them, and your photo of the page includes them.
ICAO, the International Civil Aviation Organization, writes the standard for them, Doc 9303. Part 3 covers the rules every travel document shares. Part 4 covers passports. The specimen below is the one ICAO prints in Figure 1 of Part 3, for the invented country of Utopia.
What do the two lines hold?
ICAO's specimen passport belongs to Anna Maria Eriksson of Utopia. Part 4 prints a later version of it with a 2034 expiry date, so the last digits there differ.
PPUTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<
L898902C36UTO7408122F1204159ZE184226B<<<<<10
Each line is exactly 44 characters. Part 4 lists the fields by character position, and the "<" sign fills every space a field does not use.
Line 1 holds the document and the name.
- Characters 1 and 2 are the document code. The first letter is P for a passport. The second letter gives the type, and P there means an ordinary passport, as Part 4, section 4.4 lists.
- Characters 3 to 5 are the three-letter code of the issuing country. Here it is UTO.
- Characters 6 to 44 are the name, surname first. Two "<" signs separate the surname from the given names, and one "<" replaces each space between given names.
Line 2 holds the numbers.
- Characters 1 to 9 are the passport number (L898902C3), then its check digit in position 10 (6).
- Characters 11 to 13 are the nationality (UTO).
- Characters 14 to 19 are the birth date as year, month, day (740812, so 12 August 1974), then its check digit (2).
- Character 21 is the sex, F, M or "<" for unspecified.
- Characters 22 to 27 are the expiry date (120415), then its check digit (9).
- Characters 29 to 42 are a personal number or other optional data, here ZE184226B, then its check digit (1).
- Character 44 is a last check digit that covers most of the line, called the composite (0).
Part 3 says dates in the MRZ are six digits, YYMMDD.
How does a check digit work?
A check digit is one digit worked out from the other characters in a field. Part 3 says it lets a reader confirm that the data in the MRZ was read correctly. If a scanner takes an 8 for a B, the sum no longer matches and the reader knows to try again.
The method in Part 3, section 4.9 has four steps. Multiply each character by a weight, going from left to right. The weights repeat 7, 3, 1, 7, 3, 1 and so on. Add the products. Divide the sum by 10. The remainder is the check digit. Digits count as themselves, "<" counts as 0, and letters A to Z count as 10 to 35.
Here is the passport number from the specimen, L898902C3.
- L is 21, and 21 × 7 is 147.
- 8 × 3 is 24, and 9 × 1 is 9.
- 8 × 7 is 56, and 9 × 3 is 27.
- 0 × 1 is 0, and 2 × 7 is 14.
- C is 12, and 12 × 3 is 36. The last 3 × 1 is 3.
The sum is 147 + 24 + 9 + 56 + 27 + 0 + 14 + 36 + 3 = 316. Divide by 10 and the remainder is 6. The specimen's MRZ has a 6 right after the number, so the field passes.
The rule is public, so anyone can work out the right digit for a number they invent. A correct digit says the characters were read correctly. It does not say the passport is genuine.
Is it the same on an ID card?
Not always. Part 3 says a card in the TD1 size has three lines where a passport has two. Part 5 sets each line at 30 characters. Line 1 holds the document code, the issuing country, the document number and its check digit, and optional data. Line 2 holds the birth date, sex, expiry date, nationality and a composite check digit. Line 3 holds the name. The check digit method is the same.
What can someone read from a photo of it?
Everything in those lines, if the photo is sharp. That is the name, the number, the nationality, the birth date, the sex and the expiry date. It also includes any personal number the country puts in the optional field. The list is nearly the same as the printed fields above it, and the lines print your number a second time. Part 4 says the MRZ is on the front of the data page, so a photo of the page includes it.
A cropped strip is enough. Nobody needs your face to read the lines. If you cover the printed number on a copy, cover the bottom lines too. The article on sending a copy of your ID covers what to send when someone asks.
An app that looks for the MRZ in your photos
Searching Photos by hand means scrolling for a page you may not remember taking. TegoSafe reads the text in each photo on your iPhone. A passport's machine-readable lines are one of the marks it looks for, with a number that passes its check digit. A strong match is shown as likely, the rest as possible, and you choose Lock it or Leave in Photos. When you share a Clean copy of a passport, TegoSafe covers the number in the lower line for you.
The scan and your first 25 documents are free. See how TegoSafe works. The article on finding ID photos in your camera roll shows the search by hand.
What do the < signs mean?
They are filler characters. Part 3 says a < fills every position that a field does not use. In the name, a < also replaces each space between given names.
Does a correct check digit mean the passport is real?
No. ICAO describes check digits as a way to confirm that the MRZ was read correctly. The method is published, so anyone can calculate the digit for a made-up number.
We make TegoSafe, an iPhone app for locking documents. This guide works without it.