MRZ Calculator
Reference · ICAO Doc 9303

What is the MRZ?

The Machine Readable Zone is the strip of evenly spaced characters at the bottom of passports, ID cards, and visas. Border systems and onboarding flows read it in milliseconds because every country prints the same fields in the same positions — that uniformity is defined by ICAO Document 9303.

Printed in OCR-B

The MRZ uses OCR-B, a monospaced typeface designed for optical character recognition. Because every glyph occupies the same width, a scanner can slice each line into fixed-size boxes and identify characters with very low error rates — even when the rest of the document uses decorative fonts.

P<UTODOE<<JANE<MARIE<<<<<<<<<<<<<<<<<<<<<<<<
L898902C36UTO7408122F1204159ZE184226B<<<<<10

What data is encoded

The exact slot order depends on the format, but the same family of fields shows up across every MRZ variant.

Document type
P for passport, I for ID, V for visa.
Issuing country
Three-letter ICAO state or organization code.
Document number
Up to 9 chars on most formats, padded with <.
Name
Surname, then <<, then given names separated by <.
Nationality
Three-letter ICAO nationality code.
Date of birth
Encoded as YYMMDD (e.g. 12 July 1942 → 420712).
Sex
M, F, or < for unspecified.
Expiry date
Encoded as YYMMDD; controls document validity.
Optional data
Issuer-defined slot (e.g. personal number).
Check digits
Single digits guarding each field and the composite.

Layouts by document type

TD1ID card (ID-1)
3 lines × 30 characters
I<UTOABC1234567<<<<<<<<<<<<<<<
8506152M3001019UTO<<<<<<<<<<<4
DOE<<JANE<MARIE<<<<<<<<<<<<<<<
TD2ID card (ID-2)
2 lines × 36 characters
I<UTODOE<<JANE<MARIE<<<<<<<<<<<<<<<<
ABC1234567UTO8506152F3001019<<<<<<<2
TD3Passport booklet
2 lines × 44 characters
P<UTODOE<<JANE<MARIE<<<<<<<<<<<<<<<<<<<<<<<<
L898902C36UTO7408122F1204159ZE184226B<<<<<10
MRV-AMachine Readable Visa A
2 lines × 44 characters
V<UTODOE<<JANE<MARIE<<<<<<<<<<<<<<<<<<<<<<<<
L8988901C4UTO7408122F1204159<<<<<<<<<<<<<<<<
MRV-BMachine Readable Visa B
2 lines × 36 characters
V<UTODOE<<JANE<MARIE<<<<<<<<<<<<<<<<
L8988901C4UTO7408122F1204159<<<<<<<<

Check digits (7-3-1 weights)

Each critical field carries a one-digit checksum so OCR mistakes and typos are caught immediately. The calculation is identical everywhere in the MRZ:

  1. Map each character to a number — 0–9 stay as themselves, A=10 … Z=35, and the filler < equals 0.
  2. Multiply position by position using the repeating weights 7, 3, 1.
  3. Sum the products and take mod 10. The remainder is the check digit.
Worked example — date of birth
Input:    5  2  0  7  2  7
Weights:  7  3  1  7  3  1
Products: 35 6  0  49 6  7   →  sum = 103
103 mod 10 = 3                →  check digit = 3

A composite check digit at the end of the MRZ covers a concatenation of the other field segments, so even if the individual digits look correct the overall block is verified once more.

Try it on your own MRZ

Use the in-app tools to validate, generate, convert, or batch-check Machine Readable Zones.