MRZ Parser
Decode passport and ID card MRZ lines and verify every check digit.
About this tool
Paste the two or three lines of capital letters and < chevrons from the bottom of a passport photo page or the back of an ID card. The tool detects the layout, decodes every field and verifies each check digit, including the composite check.
How the MRZ works
The machine-readable zone was standardised by ICAO Document 9303 so border scanners can read travel documents reliably. TD3 (passports) has two lines of 44 characters: document type, issuing state and name on the first line, then document number, nationality, date of birth, sex, expiry date and optional data on the second. TD1 (credit-card-sized ID cards) uses three lines of 30, and TD2 two lines of 36. Names use << between surname and given names and < for spaces. Check digits protect each key field: characters are converted to numbers (0โ9 as themselves, A=10 โฆ Z=35, <=0), multiplied by repeating weights 7, 3, 1, and the sum mod 10 gives the digit. A final composite check covers the number, dates and optional data together. The default example is ICAO's specimen passport for the fictional state of Utopia, and the decoder also validates ICAO's TD1 specimen. Honest limits: matching check digits show the MRZ was read correctly, not that a document is genuine. Two-digit years are interpreted by convention. Identity data is personal, so this runs entirely in your browser, and specimen data is best for testing. The check digit calculator and the VIN decoder are related.
Frequently asked questions
What is the MRZ on a passport?
The two lines of text at the bottom of the photo page that machines read: names, number, nationality, dates and check digits.
How is the MRZ check digit calculated?
Convert characters to numbers (A=10โฆZ=35, <=0), multiply by weights 7, 3, 1 repeating, and take the sum mod 10.
Does a valid MRZ prove a passport is real?
No. Valid check digits only show the text is consistent, not that the document is genuine.
Is my data sent anywhere?
No. Everything is checked in your browser, and nothing is stored, looked up online or sent.