Passport and ID Card MRZ Formats Explained
Not every MRZ looks the same. The format printed on a passport differs from the one on a national ID card or residence permit. If your app needs to scan passports and scan ID cards, it helps to know the three main ICAO 9303 formats: TD1, TD2, and TD3.
TD1: Small Cards with Three Lines
TD1 is the format used on credit-card-sized documents such as national ID cards and residence permits.
- Lines: 3
- Characters per line: 30
- Common documents: National ID cards, residence cards, crew member certificates
Line 1 holds the document code, issuing state, and document number. Line 2 stores the date of birth, sex, expiry date, nationality, and optional data. Line 3 stores the holder's name.
If your users scan ID cards, TD1 is the format you will see most often.
TD2: Larger ID Cards and Permits
TD2 appears on larger ID cards and some official travel documents that do not fit the TD1 layout.
- Lines: 2
- Characters per line: 36
- Common documents: Older residence permits, official ID cards, some driver's licenses
TD2 carries similar data to TD1 but spreads it across two longer lines.
TD3: The Passport Format
TD3 is the format used on passports and many machine-readable visas.
- Lines: 2
- Characters per line: 44
- Common documents: Passports, e-passports, machine-readable visas
Because passports have more room at the bottom of the data page, TD3 can store longer names and more optional data. If your app scans passports, this is the format it will handle most of the time.
Quick Comparison
| Format | Lines | Characters per line | Typical document |
|---|---|---|---|
| TD1 | 3 | 30 | National ID card |
| TD2 | 2 | 36 | Residence permit |
| TD3 | 2 | 44 | Passport |
How a Good Scanner Handles All Three
Users do not always know which format they are holding, and they should not have to. A well-built passport scanner or ID card scanner detects the format automatically from the number of lines and their length, then extracts the fields accordingly.
MoboScan handles TD1, TD2, and TD3 without any manual selection. Whether someone scans a passport or scans an ID card, the SDK returns the same structured JSON fields.
Check Digits and Validation
Each MRZ format includes check digits for important fields like the document number, date of birth, and expiry date. These digits are calculated with a weighted modulo-10 algorithm. A solid scanner validates them before returning data, so misread or tampered documents are caught early.
Summary
- TD1 is for national ID cards and similar small cards.
- TD2 is for larger ID cards and permits.
- TD3 is for passports and visas.
If your product needs to scan passports and scan ID cards from multiple countries, make sure your MRZ parser supports all three formats and validates check digits automatically.
Want to test it on real documents? Request a MoboScan demo and try scanning passports and ID cards with our SDK.
← Back to blog