Skip to content

Passport MRZ explained: how to read the two lines and use them for bookings

The MRZ is the machine readable zone, the two lines of capital letters, digits and < signs at the bottom of the passport photo page. It holds the name, passport number, nationality, date of birth, sex and expiry in a fixed layout, so you can read it by eye or by scanner.

Updated

Travel agents type passport data into bookings all day. A typo in a name or a passport number can mean a refused boarding or a paid name correction. The MRZ is the most reliable place to copy from, because it is standardised and protected by check digits. Most passports (a "TD3" document) have two lines of 44 characters each.

A sample MRZ

This is a made up passport with no real person behind it. The country code UTO is the one used in official specimen documents.

P<UTOAHMADI<<KARIM<<<<<<<<<<<<<<<<<<<<<<<<<<
L898902C36UTO7408122M2904157<<<<<<<<<<<<<<06

Line 1, field by field

PositionSampleMeaning
1PDocument type. P is a passport
2<Subtype, usually empty (a filler <)
3 to 5UTOIssuing country, a three letter code
6 to 44AHMADI<<KARIM<<<<...Surname, then two <<, then given names. A single < replaces a space. The rest is filled with <

So the booking name is AHMADI/KARIM. If a person has two given names, they appear separated by one <, for example KARIM<ALI. Long names are cut off at 39 characters, and the printed page shows the full name. Characters like accents are written without them, so the MRZ can differ from the printed name in spelling. Always book the name as the airline will check it, normally as in the MRZ.

Line 2, field by field

PositionSampleMeaning
1 to 9L898902C3Passport number
106Check digit for the passport number
11 to 13UTONationality. Can differ from the issuing country
14 to 19740812Date of birth as YYMMDD (12 August 1974)
202Check digit for the date of birth
21MSex: M, F or < for unspecified
22 to 27290415Expiry date as YYMMDD (15 April 2029)
287Check digit for the expiry date
29 to 42optional dataPersonal number or other national data, often only <
430Check digit for the personal number (0 or < when the field is empty)
446Overall check digit

The birth date has only two year digits. 74 means 1974 for a date of birth, but an expiry date of 29 means 2029. Use common sense to place the century.

Which MRZ fields feed a booking

  • Surname and given names: the name on the ticket. It must match the passport for the airline.
  • Date of birth: needed for the passenger type (adult, child or infant) and for many airlines' required passenger data.
  • Sex: some destinations and airline systems require it with the booking.
  • Nationality and issuing country: used for visa and entry rules, not usually printed on the ticket.
  • Passport number and expiry: many airlines and countries ask for these before travel. Check that the passport is valid for the period the destination demands, often six months after the return date.

Check digits in plain words

A check digit is a single number computed from the other characters in a field. If someone mistypes one character, the calculation no longer matches the digit, so the error shows up. This is why a scanner can tell you "the passport number is wrong" even without knowing the person.

The calculation is the same worldwide. Each character becomes a value: digits are themselves, A to Z are 10 to 35, and < is 0. Each value is multiplied by 7, 3 or 1 in repeating order, the results are added, and the last digit of the total is the check digit.

Check digit of the date of birth 740812
7 x 7 = 49
4 x 3 = 12
0 x 1 =  0
8 x 7 = 56
1 x 3 =  3
2 x 1 =  2
Total = 122, last digit = 2   (matches the 2 in the MRZ)

You do not need to do this by hand, but it helps to know what the digits are. If a field fails the check, do not trust any digit in it until you compare with the printed page.

Common errors when reading or typing an MRZ

  • O and 0, I and 1, S and 5, B and 8. Letters and digits look alike. In the date and number fields, the position tells you which one it must be.
  • Counting the < fillers wrongly, which shifts every field after it.
  • Dropping a second given name, or joining surname and given names into one word.
  • Reading a photo with a glare, a crease or a cut off edge.
  • Mixing up the issuing country and nationality.
  • Not checking that the passport is still valid for the trip.
  • Copying the printed name when the MRZ spelling is what the airline sees.

Some documents differ. ID cards (TD1) have three lines of 30 characters, and some visas or travel documents have two lines of 36. The idea is the same, but the positions change.

Privacy

A passport image contains everything needed for identity fraud. Treat copies like cash. Take a copy only with the customer's permission and for a real booking. Do not send passport photos over open chats or e-mail, delete copies you no longer need and keep stored copies in a place only your staff can open. Never post a real MRZ online. The sample above is a specimen for that reason.

How Parvaz fills passengers from a passport photo

In Parvaz you add a photo of a passport, or up to 30 at once, and the AI reads it into the People list. The MRZ lines are treated as the authority for the passport number, names, nationality, date of birth, sex and expiry. The surname and given names are saved separately, and the MRZ itself is kept on the person's record so you can look at it again. Duplicates are merged, so a regular customer does not appear twice.

Then you pick the person on a ticket or a booking, and their data is filled in without retyping. You still look at what was read and correct anything the photo made unclear. Reading depends on the quality of the picture, so keep passports flat and in good light. Prices and what is included are on the pricing page, and the flight itinerary maker shows how the passenger data is used.

Questions and answers

What is the MRZ on a passport?

The machine readable zone is the two lines of letters, digits and < signs at the bottom of the photo page. It holds the name, passport number, nationality, birth date, sex and expiry in a fixed layout.

What do the < signs mean?

They are fillers. A single < stands for a space in a name or an empty position, and two << separate the surname from the given names.

Which MRZ fields do I need for a flight booking?

Surname and given names, date of birth and sex for the passenger record, plus passport number, nationality and expiry when the airline or destination asks for them.

How do I know if I typed the MRZ wrong?

Use the check digits. Each key field has one, calculated from its characters. If the digit does not match the calculation, a character in that field is wrong.

Is it safe to keep passport copies?

Only with the customer's permission, for a real booking, with access limited to staff who need it, and deleted when no longer needed.

See it work in an agency like yours

Open the demo agency, full of sample tickets, people and money, with no sign-up. Or look at the plans.