Question 05
How many lines does an MRZ have?
The number of lines depends on which ICAO document format is being used, and this is one of the more practical details for anyone building or evaluating a scanning solution, since it affects both camera framing and how software parses the extracted text.
Passports use the TD3 format, which has two lines of 44 characters each. This is the format most people picture when they think of an MRZ.
It's the wide strip running the full width of a passport's data page. Many national ID cards use TD1, a three-line format with 30 characters per line, usually printed on the back of the card.
A less common format, TD2, uses two lines of 36 characters and appears on some ID cards and visas, sitting in between TD1 and TD3 in terms of layout and character count.
Visas often follow the TD2 layout as well, though visa formats vary more by issuing country than passports do. Some documents, certain residence permits, crew member certificates, and other travel documents, use variants of these formats that aren't always identical to the strict ICAO templates.
That's why a mature scanning engine needs a large library of document-specific parsers rather than a single one-size-fits-all reader.
Each line, regardless of format, ends in a check digit or a composite check digit that lets software confirm the data hasn't been altered. Line count and character count together define the "shape" a parser expects, which is part of why MRZ recognition can be so reliable once a document is correctly classified.
The system already knows exactly how many characters should appear on each line and what each position should contain.
This is a big part of why document scanning vendors, including ScanDoc, invest heavily in template libraries covering large numbers of document types and countries. Correctly identifying whether you're looking at a two-line TD3 passport or a three-line TD1 ID card is the first step in extracting the data correctly, and getting it wrong at that stage cascades into every field downstream.
Talk to a document scanning specialist
Have a specific integration question, or want to see how this fits your onboarding flow? The ScanDoc team is happy to help.