What is MRZ?
MRZ stands for Machine Readable Zone — the block of
standardised text printed at the bottom of passports, ID cards,
and visas. The format is defined by ICAO 9303, a standard issued
by the International Civil Aviation Organization that ensures
every country encodes the same fields in the same positions.
The MRZ is printed in OCR-B, a font designed for machine
reading where every character occupies exactly the same width.
That fixed spacing lets scanners divide each line into equal
slots and read characters reliably, which is why OCR-B is used
for the MRZ even when the rest of the document uses a different
typeface.
OCR-B (spec font)
K12345678NZL9907054F<<<<
What data is encoded
Each MRZ line encodes specific fields: document type, issuing
country, document number, surname, given names, nationality,
date of birth, sex, expiry date, and optional data. Dates are
written as YYMMDD, so 12 July 1942 becomes
420712.
Several fields are followed by a check digit — a single
character calculated from the field value using a weighted
algorithm defined in ICAO 9303. A composite check digit covers
multiple fields together. These digits let any reader detect
transcription errors or document tampering without external
databases.
MRZ layouts by document type
Each document type defines how many lines the MRZ contains and
how many characters each line holds. The diagrams below show the
field positions for each format.