TD1, TD2 and TD3: the three MRZ formats

TD1, TD2 and TD3 are the three machine-readable zone layouts defined by ICAO Doc 9303. TD3 is two lines of 44 characters and belongs to passports; TD2 is two lines of 36 on older identity and travel cards; TD1 is three lines of 30 on card-sized documents.

The three formats at a glance

The three MRZ formats, their sizes and an example of each
FormatLines × charactersDocument typeExample (first line)
TD32 × 44Passports and other TD3-size travel documentsP<GRCPARADEIGMA<<ELENI<SOFIA<<<<<<<<<<<<<<<<
TD22 × 36Official travel documents of TD2 size; older identity cardsI<GRCPARADEIGMA<<ELENI<SOFIA<<<<<<<<
TD13 × 30Card-size official travel documents and identity cardsIDGRCAK472913<4PN48291630<<<<<

Every line is padded to its full length with the filler character <. A zone that is not exactly 44, 36 or 30 characters per line is not a valid zone of that format — which is the first thing to check when a parser refuses one.

TD3 — two lines of 44

The passport layout. Line one carries the document code, the issuing state and the name; line two carries the document number, nationality, date of birth, sex, date of expiry, the personal number, and the check digits. The name zone here is 39 characters, so it is the rare layout where a long name is genuinely at risk of truncation. Surname and given names are separated by two fillers; single fillers separate the given names from each other.

P<GRCPARADEIGMA<<ELENI<SOFIA<<<<<<<<<<<<<<<<
AM73045184GRC9403084F3203101PN48291630<<<<72

The composite check digit sits in position 44 of the lower line and covers positions 1–10, 14–20 and 22–43 of that line. Positions 11–13 (nationality) and 21 (sex) are excluded from the composite by the standard.

TD2 — two lines of 36

The same two-line arrangement, eight characters narrower on each line. The name field is 31 characters.

I<GRCPARADEIGMA<<ELENI<SOFIA<<<<<<<<
TR61850420GRC9403084F2911043<<<<<<<2

Its composite digit is at position 36 of the lower line and covers positions 1–10, 14–20 and 22–35.

TD1 — three lines of 30

The card layout, and the one parsers most often get wrong, because the fields are distributed differently: the upper line carries the document code, issuing state, document number and the first block of optional data; the middle line carries the dates, sex and nationality; and the name has the whole lower line to itself, 30 characters.

IDGRCAK472913<4PN48291630<<<<<
9403084F3405204GRC<<<<<<<<<<<9
PARADEIGMA<<ELENI<SOFIA<<<<<<<

Its composite digit is the last character of the middle line, position 30, and it covers the upper line's positions 6–30 plus the middle line's 1–7, 9–15 and 19–29 — a range that spans two lines, which is exactly the part an implementation gets wrong.

The other layouts you will meet

Beyond the three travel-document formats:

  • MRV-A — the format-A machine readable visa: two lines of 44.
  • MRV-B — the format-B machine readable visa: two lines of 36.
  • A one-line 30-character layout used on driving-licence zones.
  • A six-character line carrying a card access number.
  • A two-line variant of 30 characters.

Our API reports the format it detected, so you do not have to infer it from the line lengths yourself.

Check digits, and what they do not cover

Each check digit is computed over its field with the repeating weights 7, 3, 1: digits count as themselves, letters as their position in the alphabet plus 9 (A = 10), and the filler < counts as 0. The sum modulo 10 is the digit.

A digit protects the document number, the date of birth, the date of expiry, and in TD3 the personal number — plus the composite over most of the zone.

No check digit covers the name, and none covers the issuing state. A misread in either is silent: the arithmetic still balances. That is the strongest argument for reading the printed side of the document as well and comparing the two readings, which is what our API does by default.

The arithmetic is worked through character by character on the MRZ checker, which then recomputes it on a zone of your own.

Where the standard says all this

ICAO Doc 9303, Machine Readable Travel Documents, Eighth Edition, 2021. The document-series landing page no longer resolves, so the parts are cited by number and title rather than linked:

The parts of ICAO Doc 9303 that define these formats
PartTitle
Part 3Specifications Common to all MRTDs
Part 4Specifications for Machine Readable Passports (MRPs) and other TD3 Size MRTDs
Part 5Specifications for TD1 Size Machine Readable Official Travel Documents (MROTDs)
Part 6Specifications for TD2 Size Machine Readable Official Travel Documents (MROTDs)
Part 7Machine Readable Visas

Part 3 holds what is common to every format — the character set, the filler, the check-digit arithmetic. Part 4 defines TD3, part 5 defines TD1, part 6 defines TD2, and part 7 defines the two visa formats. Section 4.2.4 of parts 4, 5 and 6 is where each format's check-digit table lives.

Check a zone of your own

Paste a zone into the free MRZ checker and every check digit is recomputed in front of you, in your browser — nothing is uploaded. To build a valid zone for a test fixture, use the MRZ generator; to see the full field vocabulary a recognition answers with, open the document field explorer. None of the three needs an account.

To read a whole document rather than a zone — the printed side as well as the encoded one — one request does it, and the first calls need no account. The MRZ and the visual zone explains which reading to believe when the two disagree.

Every zone on this page belongs to one invented holder — invented numbers, invented dates, and check digits computed from them rather than typed. Nothing here belongs to anybody.