What the MRZ in a passport is and what data it confirms
The MRZ (Machine Readable Zone) is the machine-readable zone at the bottom of the personal data page of a passport. It is a standardized block of text with key information about the owner and the document in a format suitable for automatic reading by scanners, cameras, and OCR systems.
The format and requirements for the MRZ are defined by the ICAO Doc 9303 document — an international standard of the International Civil Aviation Organization, approved as ISO/IEC 7501-1. The standard describes three formats of machine-readable zones: TD1 (three lines of 30 characters, used in ID cards), TD2 (two lines of 36 characters), and TD3 (two lines of 44 characters). Passports — both international and most national ones — use the TD3 format.
The MRZ is printed in the monospaced OCR-B (ISO 1073-2:1976) font, Size I — approximately 14 points. Each character occupies a fixed width of 2.54 mm, which allows the scanner to break the line into equal positions and confidently read each character. Only 37 characters are allowed: uppercase Latin letters from A to Z, Arabic digits from 0 to 9, and the filler character <. Spaces, hyphens, apostrophes, and diacritical marks are not used in the MRZ — names are transliterated according to the rules of Doc 9303 (part 3, section 6), and spaces and hyphens are replaced with the character <.
The size of the effective reading zone (ERZ) is strictly regulated: 17.0 × 118.0 mm. This zone is the same for the passports of all 193 ICAO member states, which ensures compatibility with reading equipment around the world. Since November 24, 2015, passports without a machine-readable zone have been considered invalid for international travel.
The MRZ performs two tasks in authenticity verification. The first is the duplication of key data from the visual zone (VIZ) in a standardized format, which makes it possible to match the printed and the read information. The second is mathematical verification through check digits calculated using the Doc 9303 algorithm. A discrepancy between the VIZ and the MRZ, or a mismatch of check digits, is a signal of a possible forgery or damage to the document.
Which fields are duplicated in the machine-readable zone
The first line of the MRZ in the TD3 format contains three elements: the document type, the issuing state code, and the owner’s name.
The document type is designated by one or two characters in positions 1–2. For a passport, the first character is the letter P. The second character can specify the subtype (for example, D for diplomatic) or be filled with the character <. From January 1, 2026, according to the updated version of Doc 9303, countries already using the second character are obliged to switch to standardized two-letter codes: PP for an ordinary passport, PD for a diplomatic one, PE for an emergency one, and so on. By January 1, 2028, all ICAO member states are obliged to issue passports with two-letter codes, and by 2038 documents without a standardized second character must be fully withdrawn from circulation. Passports issued before these dates with the single-letter code P< remain valid until they expire.
The state code occupies positions 3–5 and is a three-letter code under the ISO 3166-1 alpha-3 standard with a number of exceptions specified in Doc 9303. For Russia the code is RUS, for Germany — D<< (one letter with two fillers).
The remaining 39 positions of the first line (6–44) are allocated for the owner’s surname and first name. The surname is separated from the first name by a double character <<. If the full name does not fit into the allocated space, the name is abbreviated according to the rules of Doc 9303, and the last character must be a letter — an indicator that the name has been truncated.
The second line concentrates the data critical for verification:
— The document number (positions 1–9) and its check digit (position 10). — The owner’s nationality (positions 11–13), a three-letter code under ISO 3166-1 alpha-3. — The date of birth (positions 14–19) in the YYMMDD format and a check digit (position 20). — Sex (position 21): M — male, F — female, < — unspecified. In a number of countries (for example, the US and Argentina), X is allowed to denote a non-binary sex. — The expiration date (positions 22–27) in the YYMMDD format and a check digit (position 28). — The personal number or optional data (positions 29–42) at the discretion of the issuing state, and the check digit of this field (position 43). — The composite check digit (position 44), calculated over a combination of several fields of the second line.
The MRZ duplicates the passport number, nationality, date of birth, sex, and expiration date — the very data printed in the visual zone of the document. Matching the VIZ and the MRZ serves as the first line of verification: if the data diverges, the document requires in-depth analysis.
Cross-validation of the visual zone and the machine-readable zone is one of the tasks where a manual check is inferior to an automated one: the operator has to match, character by character, the transliteration of the name, the document number, the dates, and the nationality, and with a flow of applications omissions are inevitable. We will connect the NeuroVision AI-OCR module, which extracts data from both zones of the document, cross-checks them against each other, and recalculates the check digits using the ICAO algorithm — all in less than a second per document.
The module recognizes 10,000+ document types from 200+ countries with an accuracy of 99.85% for printed fields. You will receive a structured response with the extracted data and discrepancy flags, ready for processing in your system. Integration is via a REST API or SDK for Web, iOS, and Android.
What check digits are in the MRZ
Check digits are single-digit numbers calculated using the algorithm from Doc 9303 (part 3, appendix A). Their purpose is to confirm the integrity of the data: if even one character in a protected field is changed, the recalculated check digit will not match the one indicated in the document.
The TD3 format provides for five check digits:
- The document number check digit (position 10 of the second line) — calculated from the characters of positions 1–9.
- The date of birth check digit (position 20) — calculated from the characters of positions 14–19.
- The expiration date check digit (position 28) — calculated from the characters of positions 22–27.
- The personal number check digit (position 43) — calculated from the characters of positions 29–42. If the field is empty (filled with the characters <), the character < may also stand in place of the check digit — this is an acceptable exception in the TD3 format.
- The composite check digit (position 44) — covers the document number with its check digit (positions 1–10), the date of birth with its check digit (14–20), the expiration date with its check digit (22–28), and the personal number with its check digit (29–43). It acts as the final integrity check of all the numeric data of the line.
The calculation algorithm is the same for all five digits. Each character is assigned a numeric value: the digits 0–9 keep their value, the letters A–Z receive values of 10–35, and the character < equals 0. The values are multiplied by the cyclically repeating weighting coefficients 7, 3, 1 (the first position × 7, the second × 3, the third × 1, the fourth × 7 again, and so on in a cycle). The products are summed, and the remainder of dividing the sum by 10 gives the check digit.
Such a scheme reliably detects typical OCR recognition errors — the substitution of one character, the transposition of adjacent characters — and captures any manual change to the data in the MRZ. Recalculating the check digits is a mandatory step in the automated verification of a passport MRZ, whether at border control, during the remote identification of a customer, or in anti-fraud procedures.
Recalculating the check digits reveals changes in the document number, dates, and personal number, but on its own it does not answer the question of whether the passport as a whole is genuine. We will build MRZ validation into a full anti-fraud verification loop: the AI-OCR module will extract the fields and recalculate all five check digits, while 40+ anti-fraud algorithms will additionally assess the integrity of the document, the image quality, and signs of substitution.
Connection via a REST API or SDK takes from 24 hours — you will be able to test MRZ recognition and validation on real documents in a test environment for up to one month. As a result, you will receive an assessment of accuracy and speed on your flow in order to make a decision about scaling.
How to check a passport’s machine-readable zone
Checking the MRZ consists of three steps: matching the MRZ data against the visual zone of the passport, the mathematical validation of the check digits, and control of the line format. The procedure does not require special equipment — an understanding of the structure of the machine-readable zone and the calculation algorithm from ICAO Doc 9303 is enough.
Which fields to compare between the MRZ and the passport
During verification, each MRZ field is matched against the corresponding entry in the visual zone (VIZ). The value in the MRZ must exactly correspond to what is printed in the main part of the page.
For TD3-format passports, the following are cross-checked:
- Surname and first name — in the MRZ they are written in Latin script, the surname is separated from the first name by two filler characters <<, and spaces and hyphens are replaced with a single <. The transliteration in the MRZ must match the Latin spelling in the visual zone.
- Country of issue code — a three-letter code under the ICAO classifier (for example, RUS for the Russian Federation).
- Document number — the series and number of the passport without spaces; if the number is shorter than nine characters, the remaining positions are filled with the character <.
- Nationality — a three-letter ICAO code. For most passports it matches the country of issue code, but this is not mandatory.
- Date of birth — the YYMMDD format (the last two digits of the year, the month, and the day — two digits each with a leading zero).
- Sex — M, F, or < (if unspecified).
- Expiration date — the YYMMDD format.
Any discrepancy — an extra character, a different letter in the name, a date mismatch — signals an error or a possible forgery. In an automated check, the system performs cross-validation: the data extracted from the MRZ via OCR is compared with the data recognized in the visual zone. If the passport contains an electronic chip (the eMRTD format), a third source is added to the comparison — the data from the chip (Data Group 1), which must fully match the MRZ.
How to recalculate the check digits
The section on the structure of the MRZ describes the algorithm for calculating the check digits: converting characters into numeric values, multiplying by the weights 7, 3, 1, and taking the remainder of dividing the sum by 10. Here we will show how to apply it in practice.
Suppose the date of birth in the MRZ is written as 880504 (May 4, 1988). The calculation: 8×7 + 8×3 + 0×1 + 5×7 + 0×3 + 4×1 = 56 + 24 + 0 + 35 + 0 + 4 = 119. The remainder of dividing 119 by 10 is 9. The check digit is 9. If any other digit stands after this date in the MRZ, the field has failed the check.
A similar calculation is performed for the document number (positions 1–9), the expiration date (positions 22–27), and the personal number (positions 29–42). Sex and nationality are not protected by check digits.
The composite check digit (position 44) is calculated over the concatenation of several blocks: the document number with its check digit (positions 1–10), the date of birth with its check digit (14–20), the expiration date with its check digit (22–28), and the personal number with its check digit (29–43). The weighting scheme is the same — 7, 3, 1 in a cycle, modulo 10. The composite digit provides cross-validation: even if an attacker correctly recalculated one individual check digit, the error will manifest at the level of the composite checksum if all the others were not recalculated.
The replacement of one character in the number or date leads to a different remainder, and the mismatch is immediately detected — this is precisely what makes check digits one of the basic tools for detecting forgeries and reading errors.
How to check the line format, the filler characters, and the font
In addition to the content of the fields and the check digits, the ICAO Doc 9303 standard strictly regulates the physical and logical structure of the MRZ line.
| Category | Description |
|---|---|
| Allowed characters | Only 37 characters are permitted: uppercase Latin letters A–Z, digits 0–9, and the filler character <. Lowercase letters, Cyrillic, spaces, hyphens, periods — none of these can be present in the MRZ. The appearance of any extraneous character is a direct sign of a violation of the standard. |
| Length and number of lines | For passports (TD3), the MRZ consists of exactly two lines of 44 characters. For TD1-format ID cards — three lines of 30 characters, for TD2 documents — two lines of 36 characters. A deviation from these parameters indicates a non-standard or damaged document. |
| Filler characters | Unoccupied positions are filled with the character <. The surname is separated from the first name by a double <<, and the remainder of the line after the name is also filled to the end of the allocated space. If the fillers are not in their places — for example, in the middle of the document number or in the date field — this is an anomaly requiring attention. |
| Font | The MRZ is printed in the monospaced OCR-B font, developed specifically for optical recognition: each character occupies the same width, and the shape of the letters and digits minimizes confusion between similar characters (for example, 0 and O, 1 and I). If the MRZ font visually differs from OCR-B — has serifs, varying character widths, or a non-standard shape — this is a strong reason to doubt the authenticity of the document. |
In practice, a manual format check is justified in isolated cases. In industrial scenarios — customer onboarding, border control, remote verification — all these checks are performed automatically. AI-OCR systems recognize the MRZ, extract the fields, recalculate the check digits, and match the data against the visual zone in fractions of a second. The NeuroVision platform includes MRZ verification as one of the steps in the chain of document verification: from classification and recognition to integrity control and matching against biometric data.
How to detect a forgery by the MRZ
The machine-readable zone is encoded according to a strict international standard with mathematical protection. Any interference with the data disrupts the internal logic of the zone and leaves traces that can be detected programmatically or during a manual check.
Mismatch of the MRZ with the passport data
The ICAO Doc 9303 standard requires the key fields to be duplicated in the MRZ and the visual zone: surname and first name, document number, nationality, date of birth, sex, expiration date. When forging, a fraudster most often changes one of the layers — the visual or the machine-readable one — and does not synchronize the other.
In practice, discrepancies take characteristic forms. A surname in the VIZ may be written in Cyrillic or with diacritical marks, while in the MRZ it is transliterated into Latin script according to the ICAO rules. If the transliteration does not correspond to these rules or contains characters not included in the acceptable set (A–Z, 0–9, <), this indicates manual interference. The situation is similar with dates: if the date of birth in the VIZ differs from the value in the MRZ by even one digit, the document requires in-depth verification.
For automatic verification systems, comparing the VIZ and the MRZ is a basic stage. AI-OCR extracts data from both zones and matches them character by character. A discrepancy in even one field generates a risk flag, after which the document is sent for manual review or rejected.
Incorrect check digits
If a forger has changed even one character in a protected field — for example, adjusted the year of birth or substituted a different passport number — recalculating the check digit will give a result that does not match the one recorded in the MRZ. The composite check digit strengthens the protection: it covers all four individual fields and their check digits, so even if one of them is recalculated correctly, the error will manifest at the level of the composite checksum.
In practice, an incorrect check digit is one of the most reliable automatic indicators of forgery. Software verification performs the recalculation in fractions of a second and instantly detects the discrepancy, which makes check digits the first line of defense when processing documents through the API or SDK of recognition systems.
Automatic check-digit verification via an API eliminates the manual recalculation using the 7-3-1 weighting scheme and instantly detects data substitution, but the final cost depends on the document type and scale.
We will select the optimal combination of modules and deployment format — cloud or the perimeter of your infrastructure — and prepare a calculation taking into account your volumes and data security requirements.
Non-standard structure of the machine-readable zone
In addition to the content of the data, the MRZ has a strictly regulated physical and logical structure: exactly two lines of 44 characters in TD3, an acceptable set of 37 characters, and the fixed assignment of each position to a specific field.
Deviations from this structure indicate forgery with a high probability. Typical anomalies: an incorrect number of characters in a line, the presence of lowercase letters or Cyrillic, spaces instead of the fillers <, a violation of the field order, non-standard characters in positions intended only for digits (for example, a letter in place of a check digit).
A separate marker is the font. A genuine MRZ is printed in the OCR-B font, which visually differs from most everyday typefaces. Forgers often use similar but not identical fonts — the differences manifest in the proportions of individual characters, the thickness of the strokes, the inter-character spacing. The neural network classifiers used in modern document verification systems are able to detect an MRZ font substitution by analyzing the morphology of individual characters in the image.
Automated verification systems validate the structure of the MRZ before analyzing the content: first they confirm the format (the number of lines, the length, the character set), then they move on to parsing the fields and recalculating the check digits. If the document does not pass structural validation, further processing stops with the corresponding flag.
When an MRZ error requires an additional check
Not every inconsistency in the MRZ unambiguously indicates a forgery. A number of countries have allowed deviations from the ICAO standard when issuing passports — for example, they used a non-standard font in the MRZ or filled in individual fields with a deviation from the specification. The UK’s official document verification guidance directly states that some states have issued genuine passports with a non-compliant font in the machine-readable zone. Errors in the transliteration of names — especially for languages with a non-Latin script — can also arise at the document issuance stage and not be a sign of falsification.
A properly configured verification system distinguishes critical and non-critical anomalies. An incorrect check digit is a high-risk signal that requires immediate attention. A discrepancy in the transliteration of a name when all the other fields match and the check digits are correct is a less significant factor that can be resolved by reconciliation with additional sources.
The optimal approach is multi-level verification, in which the MRZ acts as one of the verification layers rather than the only one. The MRZ data is matched against the visual zone, and if an NFC chip is present (in biometric passports) — also against the cryptographically protected information on the chip. The combination of these checks makes it possible to confidently distinguish production defects from deliberate falsification, reducing both false positives and the missing of real forgeries.
Dividing anomalies into critical and non-critical requires not only checking the machine-readable zone but also matching it against other data layers — the visual zone, the chip, the owner’s biometrics. We will set up the full NeuroVision KYC pipeline, where MRZ validation becomes one of the steps in the chain: AI-OCR recognizes the document and checks the structure, fields, and check digits, the NeuroVision module compares the selfie with the photo from the document with a verification accuracy of 99.74%, and a liveness check with an accuracy of 99.9% confirms that a live person is in front of the camera rather than a photo, video, or mask.
Deployment of the full loop takes from 3 to 7 days depending on the infrastructure and information security requirements. Submit a request — together we will determine the set of modules and the verification scenario suitable for your processes and regulatory requirements.
The machine-readable zone turns a paper document into an object with built-in digital protection: the strict TD3 structure, the limited character set, five check digits under the ICAO algorithm, and the mandatory duplication of the visual zone data create a system where any interference disrupts the internal logic and becomes detectable.
Matching the VIZ and the MRZ, recalculating the check digits, and checking the line format and the OCR-B font form a multi-level control that works both during manual inspection and in automated verification systems. At the same time, competent MRZ verification takes context into account: not every anomaly means falsification, and a single discrepancy requires matching against other data layers — from the visual zone to the cryptographically protected information on the NFC chip of a biometric passport. The combination of mathematical validation, the cross-checking of sources, and the separation of critical and non-critical deviations makes it possible to reduce both false positives and the missing of real forgeries, making the MRZ a reliable element in the chain of documentary anti-fraud.