MRZ & ICAO 9303: How Passport OCR Works

By PicToText Team•2025-08-10

Have you ever wondered why your passport can be scanned and verified in just seconds at an automated airport gate? Whether you're traveling from Tokyo to New York or from London to Sydney, border control systems can instantly read your passport, regardless of which country issued it.

The secret isn't magic—it's a powerful global standard known as ICAO 9303, published by the International Civil Aviation Organization. This document serves as the "universal technical language" for travel documents worldwide, and at its heart is a brilliant feature called the Machine-Readable Zone (MRZ).

What is a Machine-Readable Zone (MRZ)?

The Machine-Readable Zone is the block of text at the bottom of your passport's identity page. Unlike the human-readable information at the top (called the Visual Inspection Zone or VIZ), the MRZ is specifically designed for machines to read with exceptional speed and accuracy.

The MRZ uses a special font called OCR-B—a clean, monospaced typeface that's optimized for Optical Character Recognition (OCR) software. All your critical identity data—name, passport number, nationality, date of birth, and expiration date—is encoded within these lines in a standardized format.

This standardization is what makes passport OCR so reliable. Every passport in the world follows the same MRZ format, meaning a scanner in any country can instantly understand the document's data structure.

The Three MRZ Formats: TD1, TD2, and TD3

While the MRZ concept is universal, ICAO 9303 defines different formats to accommodate various document sizes:

TD3 Format (Standard Passport)

This is the format used in all passport booklets globally. It consists of:

  • Two lines
  • 44 characters per line

Every passport you see at international airports uses this TD3 format, making it the most common MRZ layout worldwide.

TD3 Example: Breaking Down the Structure

Let's examine a typical TD3 MRZ example:

P<USASMITH<<JOHN<MICHAEL<<<<<<<<<<<<<<<<<<<<
1234567897USA8501011M2501019<<<<<<<<<<<<<<06

First Line (44 characters):

  • P< - Document type (P = Passport)
  • USA - Issuing country (United States)
  • SMITH<<JOHN<MICHAEL<<<<<<<<<<<<<<<<<<<< - Name fields:
    • SMITH - Primary identifier (surname)
    • JOHN - First given name
    • MICHAEL - Second given name
    • << and < separators indicate field boundaries

Second Line (44 characters):

  • 123456789 - Passport number
  • 7 - Check digit for passport number (validates: 123456789)
  • USA - Nationality
  • 850101 - Date of birth (YYMMDD format: 1985-01-01)
  • 1 - Check digit for date of birth (validates: 850101)
  • M - Sex (M = Male, F = Female, < = Not specified)
  • 250101 - Date of expiry (YYMMDD format: 2025-01-01)
  • 9 - Check digit for expiry date (validates: 250101)
  • <<<<<<<<<<<<<<06 - Personal number (optional) + final check digit

This structured format allows OCR systems to instantly parse and validate every piece of information with mathematical certainty.

TD1 Format (Credit Card-Sized Documents)

This format is designed for smaller documents and consists of:

  • Three lines
  • 30 characters per line

TD1 is commonly used for:

  • National ID cards (especially in the European Union)
  • U.S. Passport Cards
  • Other government-issued credentials

TD2 Format (Less Common)

A middle-ground format that's rarely used in modern documents but part of the ICAO 9303 specification.

Regardless of which format is used, the purpose remains the same: to provide a structured, predictable data zone that enables document OCR systems to extract information reliably every single time.

The Secret Weapon: Check Digits

Perhaps the most ingenious aspect of the MRZ design is the use of check digits. These are calculated values embedded within the MRZ that serve as a built-in validation mechanism.

How Check Digits Work

  1. A specific algorithm calculates a check digit based on the data that precedes it (like the passport number or date of birth)
  2. When an OCR system reads the MRZ, it performs the same calculation
  3. The system compares its calculated result to the printed check digit
  4. If they match: the data was read correctly
  5. If they don't match: an error occurred, and the system can flag the document for review

This self-validation mechanism acts like a built-in "data cop," dramatically increasing accuracy and reducing OCR errors to near zero. It's a critical feature that makes automated passport control systems so reliable.

Why MRZ is a Game-Changer for Identity Verification

For developers and businesses building identity verification solutions, the presence of an MRZ on a document is the single most important factor determining OCR reliability.

Documents WITH MRZ (High Reliability)

  • All international passports (TD3 format)
  • EU ID cards (TD1 format)
  • German ID card
  • U.S. Passport Card
  • Other standardized travel documents

Result: Data extraction is fast, accurate, and highly dependable. Success rates for automation are extremely high, often exceeding 99%.

Documents WITHOUT MRZ (Lower Reliability)

  • Chinese national ID card
  • Many driver's licenses
  • Non-standardized regional ID cards

Result: Document OCR must rely entirely on analyzing the Visual Inspection Zone (VIZ). This process faces challenges like varying fonts, layouts, print quality, glare, and physical wear, making the technical difficulty and error rate significantly higher.

The Global Impact of ICAO 9303

The ICAO 9303 standard has revolutionized international travel and identity verification:

  • Universal Interoperability: A passport issued in Japan can be instantly read by a system in the United States
  • Reduced Processing Time: Automated gates can process passengers in seconds rather than minutes
  • Enhanced Security: Check digits and standardized formats make forgery detection more reliable
  • Developer-Friendly: APIs can be built with confidence knowing the data format is globally consistent

Building with MRZ: A Developer's Perspective

At PicToText, we've built our passport OCR API with deep understanding of the MRZ standard. Our system:

  • Recognizes all TD1, TD2, and TD3 formats automatically
  • Validates check digits to ensure data accuracy
  • Returns structured JSON data for easy integration
  • Supports documents from dozens of countries worldwide

Whether you're building a fintech onboarding flow, a hotel check-in system, or a global identity verification platform, understanding MRZ is essential to building reliable document OCR solutions.

To learn more about implementing passport and ID card recognition in your application, check out our API documentation.

The Future of Document Verification

While the MRZ has been remarkably successful, the future of travel documents is evolving. ICAO 9303 now also defines standards for embedded chips (ePassports) and digital credentials. However, the MRZ remains the backbone of physical document verification and will continue to play a critical role for years to come.

The next time you breeze through an automated airport gate, you'll know the secret behind the speed and accuracy: the ICAO 9303 standard and its brilliant core innovation, the Machine-Readable Zone. It's more than just a convenience for travelers—it's a foundational element of global interoperability and a masterclass in building robust, reliable, and truly international identity verification systems.


Ready to integrate passport and ID card OCR into your application? Visit pictotext.io to try our API for free, or explore our comprehensive documentation to get started in minutes.