MRZ

The strip of characters at the bottom of a passport or an ID card, written to be read by a machine before a person. What it encodes, what formats it appears in, and why its check digit is the first thing that gives away an alteration.

In short

The MRZ (machine readable zone) is the strip of two or three lines of monospaced characters that appears at the bottom of a passport, an ID card, or a residence permit. It repeats, in a fixed format and in the same order in every country, the data the document already shows printed above it.

Its form is not aesthetic: the typeface, the character set, and the position of each field are defined by the ICAO 9303 standard, which standardizes machine-readable travel documents. That is why the same routine can read a passport issued in any country without knowing beforehand which one it is.

The strip also self-checks. Several fields carry a check digit calculated over their own characters, which makes it possible to catch a faulty read or a crude alteration of the data on the spot.

What data it encodes

The MRZ is not free text. Each position corresponds to a field, and the fields are always the same.

  • Document type — one or two letters that distinguish a passport from an ID card or a residence permit.
  • Issuing state — the country that issued the document, in a three-letter code.
  • Surnames and given names — in a single string, with a double filler character separating surnames from given names.
  • Document number — the identifier assigned by the issuer.
  • Nationality — also in a three-letter code, and it does not always match the issuing state.
  • Date of birth and expiration date — in a six-digit format: year, month, and day.
  • Sex — one letter, with the option of leaving it unspecified.
  • Optional data — a space each country uses at its own discretion, usually for a personal or registry number.
  • Check digits — one per checked field, plus a composite one that covers several fields at once.

Two details explain most of the discrepancies an operations team sees. The first: the character set only allows unaccented letters, digits, and the filler character <. Names with accents, with ñ, or with non-Latin characters get transliterated, so the MRZ string may not match character for character what is printed above it on the same document. That is correct, not a reading error.

The second: when a name does not fit the available space, it gets truncated. A long surname can appear incomplete in the strip and in full on the front.

The three formats

The standard defines three formats, and the name describes the size of the whole document, not just the strip.

  • TD1 — three lines of 30 characters. This is the card format: ID cards, residence permits, credentials the size of a bank card.
  • TD2 — two lines of 36 characters. An intermediate format, less common in the region.
  • TD3 — two lines of 44 characters. This is the passport format.

Machine-readable visas use their own variants, with their own structure.

Knowing which format the strip is in matters for a practical reason: it defines how many lines need to be captured and where each field ends. A capture that cuts off the third line of a TD1 does not return incomplete data, it returns misaligned data.

Why the check digit is worth so much

The calculation is simple, and that is its whole point. A weighting that repeats in a cycle, 7, 3, 1, is applied to the field's characters. Each character contributes a value: digits contribute their own value; letters contribute a value from 10 for A up to 35 for Z; the filler character contributes zero. The values get multiplied by their weight, added up, and the remainder of dividing by ten is taken. That remainder is the check digit.

There is also a composite digit, calculated over several fields together instead of just one, which goes at the end of the line that encodes the personal data: the second line in all three formats. In TD1 the third line carries only the names.

This has two concrete consequences.

The first is about read quality. If the system confuses a zero with the letter O, the digit stops matching and the error shows up immediately, with no need to check against any other source. It is a free check that runs on the document itself.

The second is about integrity. Whoever alters a date of birth in the strip has to recalculate that field's digit and also the composite one. An alteration made without that care gets caught with nothing more than arithmetic.

It is worth saying how far this goes. The check digit confirms consistency, not authenticity. The rule is public and anyone can apply it, so a well-made forgery will have correct digits. What the strip demonstrates is that its data is internally coherent. Whether the document is genuine gets established another way: the security features of the substrate, the chip's signature when the document has one, and the front-and-back cross-check.

MRZ, barcode, and chip

The same document can carry its data in three different representations, and each offers different guarantees.

  • MRZ — printed text, readable with any camera and no decoder. It self-checks with its digits. It does not prove authenticity.
  • [PDF417](/glosario/pdf417) — the two-dimensional barcode many ID cards and licenses carry on the back. It holds more data than the strip and tolerates partial damage to the print, but it needs to be decoded.
  • [NFC chip](/glosario/chip-nfc) — the data is signed by the issuing authority, and that signature can be verified. It is the only one of the three that vouches for the authenticity of the data and not just its content, because it is signed by the issuing authority.

There is also a relationship between the strip and the chip that often gets overlooked: in chip-equipped documents, accessing the stored information requires a key derived from data printed on the document itself, and in the most widespread scheme that data comes from the MRZ. The strip is not a redundant copy. It is also the key to unlocking the chip, and that is why a flow that wants to read the chip first needs to read the strip correctly.

Frequently asked questions

MRZ stands for machine readable zone. It is the strip of two or three lines of monospaced characters located at the bottom of a passport, an ID card, or a residence permit, which repeats in fixed format the data the document shows printed. Its structure, its typeface, and the order of its fields are defined by the ICAO 9303 standard, which allows the same routine to read documents from different countries.

No. The strip is mandatory on machine-readable travel documents, starting with the passport, and many countries adopted the same format for their ID cards and residence permits. But earlier versions of national documents that never carried it still coexist and remain valid until they expire. In those cases, the structured data is usually in the barcode on the back instead of in a strip.

You can trust that they are consistent, which is not the same as trusting that they are true. The check digits prove the fields were not misread or carelessly altered, and that check runs on the document itself without consulting any external source. Authenticity is a different question, and it gets answered with the substrate's security features, with the chip's cryptographic signature when the document has one, and by checking the strip against what is printed on the other side.

Because the strip allows a reduced character set, with no accents and no non-Latin characters, and because it truncates whatever does not fit in the assigned space. A surname with an accent appears without it, and a long name can appear cut off. This is the standard's expected behavior, not a reading defect, and a process that treats it as a discrepancy will reject legitimate documents.

One identity, one SDK

VU ONE brings identity verification, authentication and fraud protection together on a single identity graph.

The verification you run at signup stays available to authentication and to your fraud rules, with no repeated processes and no duplicated data.

Verify, Authenticate and Protect, consolidated in one place.

Request a demo