Machine-readable passport

A machine-readable passport (MRP) is a machine-readable travel document (MRTD) with the data on the identity page encoded in optical character recognition format. Many countries began to issue machine-readable travel documents in the 1980s.
Most travel passports worldwide are MRPs. They are standardized by the "ICAO Document 9303" (endorsed by the International Organization for Standardization and the International Electrotechnical Commission as ISO/IEC 7501-1) and have a special "machine-readable zone" ("MRZ"), which is usually at the bottom of the identity page at the beginning of a passport. The "ICAO Document 9303" describes three types of documents. Usually passport booklets are issued in "Type 3" format, while identity cards and passport cards typically use the "Type 1" format.
The "machine-readable zone" of a Type 3 travel document spans two lines, and each line is 44 characters long. The following information must be provided in the zone: name, passport number, nationality, date of birth, sex, and passport expiration date. There is room for optional, often country-dependent, supplementary information.
The "machine-readable zone" of a Type 1 travel document spans three lines, and each line is 30 characters long.
Computers with a camera and suitable software can directly read the information on machine-readable passports. This enables faster processing of arriving passengers by immigration officials, and greater accuracy than manually read passports, as well as faster data entry, more data to be read and better data matching against immigration databases and watchlists.
Apart from optically readable information, many passports contain an RFID chip which enables computers to read a higher amount of information, for example a photo of the bearer. These passports are called biometric passports.
Format.
Passport booklets.
Passport booklets have an identity page containing the identity data. This page is in the TD3 size of 125 × 88 mm (4.92 × 3.46 in).
The data of the machine-readable zone consists of two rows of 44 characters each. The only characters used are A–Z, 0–9 and the filler character <.
The format of the first row is:
In the name field, spaces, hyphens and other punctuation are represented by <, except apostrophes, which are skipped. If the names are too long, names are abbreviated to their most significant parts. In that case, the last position must contain an alphabetic character to indicate possible truncation, and if there is a given name, the two fillers and at least one character of it must be included.
The format of the second row is:
Official travel documents.
Smaller documents such as identity and passport cards are usually in the TD1 size, which is 85.6 × 54.0 mm (3.37 × 2.13 in), the same size as credit cards.
The data of the machine-readable zone in a TD1 size card consists of three rows of 30 characters each. The only characters used are A–Z, 0–9 and the filler character <.
Some official travel documents are in the larger TD2 size, 105.0 × 74.0 (4.13 × 2.91 in). They have a layout of the MRZ with two rows of 36 characters each, similar to the TD3 format, but with 31 characters for the name, 7 for the personal number and one less check digit. Yet some official travel documents are in the booklet format with a TD3 identity page.
The format of the first row for TD1 (credit card size) documents is:
In addition to ISO 3166-1 alpha-3 code with modifications used for issuing country in passports, also the following organization is accepted:
The format of the second row is:
The format of the third row is:
Machine-readable visas.
The ICAO Document 9303 part 7 describes machine-readable visas. They come in two different formats:
The format of the first row of the machine-readable zone is:
The format of the second row is:
Specifications common to all formats.
The ICAO document 9303 part 3 describes specifications common to all Machine Readable Travel Documents.
The dimensions of the effective reading zone (ERZ) is standardized at in height with a margin of 3 mm at the document edges and 3.2 mm at the edge against the visual readable part. This is in order to allow use of a single machine reader.
Only characters A to Z (upper case), 0–9, and < (angle bracket) are allowed.
Nationality codes.
The nationality codes shall contain the ISO 3166-1 alpha-3 code with modifications for all formats. The check digit calculation method is also the same for all formats.
Some values that are different from ISO 3166-1 alpha-3 are used for the issuing country and nationality field:
Other values, which do not have broad acceptance internationally, include:
Сhecksum calculation.
The check digit calculation is as follows: each position is assigned a value; for the digits 0 to 9 this is the value of the digits, for the letters A to Z this is 10 to 35, for the filler < this is 0. The value of each position is then multiplied by its weight; the weight of the first position is 7, of the second it is 3, and of the third it is 1, and after that the weights repeat 7, 3, 1, and so on. All values are added together and the remainder of the final value divided by 10 is the check digit.
Names.
Due to technical limits, characters inside the Machine Readable Zone (MRZ) need to be restricted to the 10 Arabic numerals, the 26 capital Latin letters A through Z, and the filler character <.
Apostrophes and similar punctuation marks have to be omitted, but hyphens and spaces should be replaced by an opening angle bracket.
Diacritical marks are not permitted in the MRZ. Even though they may be useful to distinguish names, the use of diacritical marks in the MRZ could confuse machine-reading equipment.
Section 6 of the 9303 part 3 document specifies transliteration of letters outside the A–Z range. It recommends that diacritical marks on Latin letters A-Z are simply omitted (ç → C, ð → D, ê → E, ñ → N etc.), but it allows the following transliterations:
å → AA
ä → AE
ð → DH
ij (Dutch letter; capital form: IJ, the J as part of the ligature being capitalized, too)→ IJ
ö → OE
ü → UE (German) or UXX (Spanish)
ñ → NXX (UXX and NXX are not used in reality)
The following transliterations are mandatory:
æ → AE
ø, œ → OE
ß → SS
þ → TH
In Germany, Austria, Switzerland, Hungary and Scandinavia it is standard to use the Å→AA, Ä or Æ→AE, Ö or Ø→OE, Ü→UE, and ß→SS mappings, so Müller" becomes MUELLER, Gößmann becomes GOESSMANN, and Hämäläinen becomes HAEMAELAEINEN. ð, ñ and ü occur in Iceland and Spain, but they write them as D, N and U.
Austrian passports may (but do not always) contain a trilingual (in German, English, and French) explanation of the German umlauts and ß, e.g. 
'ß' entspricht / is equal to / correspond à 'SS'.
There are also tables for the transliteration of names written using Cyrillic and Arabic scripts, mainly based on transliteration rules into English. For example, the Russian surname Горбачёв ("Gorbatschow" in German, "Gorbatchov" in French, "Gorbachov" in Spanish, "Gorbaczow" in Polish) is transcribed "Gorbachev" in both English and according to the ICAO 9303 rules.
People having names using the listed letters always have trouble with ignorant officials; for example, the document is thought to be a forgery or with airline tickets not having the same spelling as the passport.
Russian visas (and Russian internal passports since 2011) have a different transliteration into the machine-readable zone. As an example, the letter "ч" is usually transcribed as "ch" in Russian travel documents, however, Russian visas and internal passports use "3" in the machine-readable zone instead. Another example is "Alexei" (travel passport) => "Алексей" (Cyrillic version) => "ALEKSEQ" (machine readable version in an internal document). This makes it easier to transliterate the name back to Cyrillic.
First and given names.
For airline tickets, visas and more, the advice is to only use the first name written in the passport. This is a problem for people who use their second name (as defined by the order in the passport) as their main name in daily speech. It is common, for example in Scandinavia, that the second or even third name is the one defined for daily usage. For example, the actor Hugh Laurie, whose full name is James Hugh Calum Laurie. Swedish travel agents usually book people using the first and daily name if the first one is not their main name, despite advice to use only the first name. If this is too long, the spelling in the MRZ could be used.
For people using a variant of their first name in daily speech, for example the former US president Bill Clinton whose full name is William Jefferson Clinton, the advice is to spell their name as in the passport.
In Scandinavian legislation, middle name is a name placed between given and surname, and is usually a family name. Such names are written as extra surname in the passports. People have been stranded at airports since they entered this extra family name in the "middle name" field in airline booking form, which in English speaking tradition is a given name.
Chinese, Japanese and Korean names might pose a challenge too, since the family name is normally written first. Tickets should use given name and surname as indicated in passports.