Axon Toolbox

Free telecom & identity tools · runs in your browser

Free tool

MRZ Generator & Parser

Build or decode the machine-readable zone on passports, ID cards and visas — TD1, TD2, TD3, MRV-A and MRV-B per ICAO Doc 9303 — with full check-digit verification and a printable specimen document.

MRZ Generator

Pick a format and fill in the details. Every check digit — including the composite, where the format has one — is calculated for you.

TD3 — Passport

UTO

UTO

Up to 9 characters

Placed wherever this format has room

MRZ: 740812

MRZ: 360728

Every MRZ and specimen document this tool produces is synthetic test data. Check digits are genuinely valid, but document numbers are not issued by any government and belong to no real person. The specimen is watermarked SPECIMEN and is not a travel document.

How a passport MRZ (TD3) is structured

A passport's machine-readable zone is two lines of 44 characters. Taking the ICAO specimen L898902C36UTO7408122F3404159ZE184226B<<<<<16 as an example of the second line:

The segments of a TD3 (passport) MRZ, second line
DigitsSegmentMeaning
L898902C3Document numberThe passport number, padded with < to 9 characters, followed by its own check digit.
6Check digitA check digit over the document number alone.
UTONationalityICAO 3-letter country code — UTO is the fictional specimen state used in Doc 9303’s own examples.
740812Date of birthYYMMDD, each date followed by its own check digit.
ZE184226B<<<<<Optional dataFree text at the issuing state’s discretion — often a national personal number.
16Composite check digitOne further check digit computed over several non-contiguous ranges of the line above, covering the document as a whole.

The first line carries the document code, issuing state and name in the same SURNAME<<GIVEN<NAMES convention used by every ICAO format. TD1 and TD2 follow the same design with different field widths, and TD1 uniquely spreads its fields across three lines rather than two. MRV-A and MRV-B — the visa formats — carry the same three per-field check digits but no composite check digit at all.

Why generate test MRZ data?

Any system that reads travel or identity documents — border kiosks, KYC onboarding, hotel and telecom registration, airline check-in — needs realistic MRZ strings to test against: the parser logic, the check-digit maths, the name-truncation rules, and the physical scanner reading a printed page.

Using a real passport or ID number in a test environment risks exposing genuine personal data. Synthetic MRZs that are structurally and arithmetically correct let you exercise the same code paths — field extraction, date parsing, checksum verification, barcode and OCR scanning — without any real document ever entering your test systems.

Frequently asked questions

What is the MRZ on a passport or ID card?
The machine-readable zone — the block of OCR-B text at the bottom of a passport data page or the back of many ID cards. It repeats the document’s key details (name, document number, nationality, dates, sex) in a fixed-width format defined by ICAO Doc 9303, with check digits so a scanner can verify it was read correctly, without relying on a database lookup.
What is the difference between TD1, TD2, TD3, MRV-A and MRV-B?
They are ICAO’s five MRZ layouts. TD3 is the passport format: 2 lines of 44 characters. TD2 is a 2×36 format used for some official travel documents. TD1 is the 3×30 format on the back of most credit-card-sized ID cards. MRV-A (2×44) and MRV-B (2×36) are for machine-readable visas, and — unlike the other three — carry no overall composite check digit.
How is the MRZ check digit calculated?
Each check digit is a modulus-10 checksum over a specific range of characters, using repeating weights of 7, 3 and 1. Digits count as themselves, A–Z count as 10–35, and the filler character < counts as 0. The composite check digit (TD1, TD2 and TD3 only) is calculated the same way, but over several non-contiguous ranges concatenated together — this tool computes and verifies every one of them.
Why does the specimen say "Utopia"?
UTO is ICAO’s own fictional country code, used throughout Doc 9303’s official worked examples for exactly this reason — so nobody mistakes a specimen for a real document. It is the default here, though any issuing state can be selected for the MRZ text and specimen.
Are these real passport, ID or visa numbers?
No. Every MRZ and specimen this tool produces is randomly generated test data. The check digits are genuinely valid so the data passes format and checksum validation, but the document numbers are not issued by any government and belong to no real person. The specimen document is watermarked SPECIMEN and marked "not a travel document".
Can I use the specimen to test a scanner's OCR?
For parser and format logic, yes — paste the generated MRZ text straight into your code. For a physical scanner’s optical character recognition, no: real MRZs are printed in the OCR-B typeface, which is not freely licensable, so this specimen is set in a monospace web font instead. It will validate correctly if your software reads the printed text, but it will not exercise OCR-B-specific character recognition.