PDF Guides

How to Read a Passport MRZ and Check Its Digits (Free, Offline)

What the machine-readable zone on passports and ID cards contains, how the 7-3-1 check digits work, and how to read MRZ lines from a photo privately.

Saizul Amin
Saizul Amin28 Oct 2026 · 4 min read
How to Read a Passport MRZ and Check Its Digits (Free, Offline)

How to Read a Passport MRZ and Check Its Digits

At the bottom of every modern passport data page there are two long lines of capital letters, numbers and chevrons (<). Many ID cards and residence permits have three shorter lines on the back, and visas carry a similar block. This is the machine-readable zone, or MRZ. It was designed so that border control scanners could read the key facts quickly, but it is just as handy for anyone who has to copy passport details into a form: hotel and hostel staff, travel agents, HR teams doing onboarding, event organisers and landlords. This guide explains what the lines mean, how their check digits catch mistakes and how to read them with the free Passport and ID MRZ Reader without sending the image anywhere.

The layouts

The International Civil Aviation Organization defines the MRZ in Document 9303. There are three main sizes:

  • TD3, used in passports: two lines, 44 characters each.
  • TD2, used in some ID cards and older travel documents: two lines of 36.
  • TD1, the credit-card format of most national ID cards and residence permits: three lines of 30.

Visas use MRV-A (44 characters) or MRV-B (36 characters) and start with the letter V.

In a passport, line one starts with P, then a character for the document type, the three-letter code of the issuing state, and the name: surname, two chevrons, then given names separated by single chevrons. Line two holds the document number, nationality, date of birth, sex, expiry date and optional personal number, each followed by its own check digit, and a final overall check digit.

How the check digits work

Each character gets a value: digits are themselves, A is 10 up to Z at 35, and the filler < is 0. The values are multiplied in turn by 7, 3 and 1, repeating, and added up. The last digit of the total is the check digit. Because every position is weighted, a single wrong character almost always changes the result, and the overall digit protects several fields at once.

That is why the reader shows a table of checks. When they are all correct, the lines were read exactly as printed. When one fails, the usual cause is optical character recognition confusing similar shapes: O and 0, I and 1, B and 8, S and 5. The tool already repairs these in fields that must be numbers, but heavily worn prints can still fail.

Getting a clean read

  1. Lay the document flat on a dark surface in good, even light.
  2. Avoid glare: tilt the page slightly away from a lamp or window so the laminate does not reflect.
  3. Fill most of the frame with the data page and keep the lines horizontal.
  4. Load the photo or scan, leave "Bottom of the page" selected and press Read MRZ.

The reader crops the lower part of the page, runs text recognition limited to the 37 characters the MRZ can contain, and looks for two or three lines of the right length. A green outline shows where the lines were found. If a document has the MRZ somewhere else, choose "Anywhere on the page". If you already have the lines as text, for example from a hotel system, choose pasted lines instead.

What you get

The results table gives the format, document type, issuing country, surname, given names, document number, nationality, date of birth, sex, expiry date and optional data, plus whether the document has expired. Dates are written as YYYY-MM-DD, so they sort correctly in a spreadsheet. Download CSV for a register, Excel for colleagues or JSON for a system import. Several documents can be processed together; each page becomes a row.

Privacy matters

Passport details are personal data, and in many countries they are treated with extra care. The reader runs in your browser, so the image never leaves your device. You can mask most of the document number in the table and produce a copy of the scan with the MRZ blacked out, which is useful when you need to keep a record that a document was seen but not the full number. Keep only what your purpose requires and delete copies when you no longer need them.

What a correct result does not mean

Check digits are arithmetic. A forger can print lines with correct digits, and a genuine passport can be reported lost or stolen. A valid MRZ tells you the data was captured faithfully, nothing more. Checking that a document is genuine and belongs to the person in front of you needs a trained person, the physical security features or the chip, and official procedures. Treat this tool as a typing aid, not as verification, and follow your employer's or regulator's guidance for identity and right-to-work checks.

Troubleshooting

  • No MRZ found: take a sharper photo, closer and straighter, or switch to "Anywhere on the page".
  • One check fails: compare that field with the printed line; correct it in the paste box.
  • Name looks cut short: long names are truncated in the MRZ itself; use the full name from the printed page.
Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages