ICAO Doc 9303: A Developer’s Guide to Passport Data

What ICAO Doc 9303 standardizes for passports and ID cards, from the data page layout and MRZ to the chip, and what it means for OCR integrations.

What 9303 covers

ICAO Doc 9303 defines machine readable travel documents: passport data page layout, MRZ formats, check digits, country codes, and the electronic chip used in e-passports.

Extracting It Automatically

When you read this data from photos, the Passport OCR API returns it as structured JSON, and you can apply the rules on this page as validation. Try it with the free scanner.

Where This Fits

  • Visual inspection zone: The printed fields above the MRZ follow a standard order but allow national variation in labels, languages, and optional fields such as place of birth or personal numbers.
  • Country codes: Issuing state and nationality use three-letter codes based on ISO 3166-1 alpha-3, with ICAO-specific codes for some organizations and special cases.
  • What OCR can and cannot do: OCR reads the printed data page. Chip reading needs NFC hardware and access keys and is outside an image-based API.
Need more testing? Create a free account to get 200 free credits (equals 100 Passport scans).

Extract It with the API

Read the document from a photo and validate the returned fields.

Prerequisite: Python 3.9+, `pip install requests`, and a STRUCTOCR_API_KEY

PYTHON EXAMPLE
import base64
import os
import requests

with open("passport.jpg", "rb") as image_file:
    image = base64.b64encode(image_file.read()).decode("ascii")

response = requests.post(
    "https://api.structocr.com/v1/passport",
    headers={"x-api-key": os.environ["STRUCTOCR_API_KEY"]},
    json={"img": image},
    timeout=30,
)
response.raise_for_status()
data = response.json()["data"]
print("passport_number:", data.get("passport_number"))
print("surname:", data.get("surname"))
print("given_names:", data.get("given_names"))
print("date_of_expiry:", data.get("date_of_expiry"))

Technical Specs

  • •Endpoint: POST https://api.structocr.com/v1/passport
  • •Authentication: x-api-key request header
  • •Inputs: JPG, PNG, or WebP as Base64 JSON; maximum 4.5MB
  • •Price: 2 credits per successful request; failed requests are not billed
  • •Free trial: 200 free credits on sign-up, no credit card required

Key Features

  • •Visual inspection zone: The printed fields above the MRZ follow a standard order but allow national variation in labels, languages, and optional fields such as place of birth or personal numbers.
  • •Country codes: Issuing state and nationality use three-letter codes based on ISO 3166-1 alpha-3, with ICAO-specific codes for some organizations and special cases.
  • •What OCR can and cannot do: OCR reads the printed data page. Chip reading needs NFC hardware and access keys and is outside an image-based API.
  • •Validate after OCR: Apply these rules to API output before storing it.

Reference Summary

Key facts from this page in structured form, for quick lookup.

{
  "What 9303 covers": "ICAO Doc 9303 defines machine readable travel documents: passport data page layout, MRZ formats, check digits, country codes, and the electronic chip used in e-passports..",
  "Visual inspection zone": "The printed fields above the MRZ follow a standard order but allow national variation in labels, languages, and optional fields such as place of birth or personal numbers..",
  "Country codes": "Issuing state and nationality use three-letter codes based on ISO 3166-1 alpha-3, with ICAO-specific codes for some organizations and special cases..",
  "What OCR can and cannot do": "OCR reads the printed data page."
}

Frequently Asked Questions

Is reading the MRZ enough to verify a passport?

No. Reading data and verifying authenticity are different steps; authenticity checks need security-feature or chip verification.

Which fields does StructOCR return?

Passport number, names, nationality, dates, sex, issuing details, and country-specific fields where printed.

You May Also Like

Related tutorials, platform guides, and comparisons

Country Tutorial

New Zealand Passport OCR with Node.js SDK

Use the official StructOCR Node.js SDK with TypeScript and Express to extract structured MRZ and VIZ data from New Zealand passports.

Node.js · Passport
Country Tutorial

France Passport OCR with Python SDK

Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from France passports with a server-side integration.

Python · Passport
Tutorial

Mindee passport API Alternative: Passport OCR API

Mindee passport API compared with the StructOCR REST API for passport extraction: deployment, pricing model, and when each fits.

Passport
Country Tutorial

Thailand Passport OCR with Node.js SDK

Use the official StructOCR Node.js SDK with TypeScript and Express to extract structured MRZ and VIZ data from Thailand passports.

Node.js · Passport
Country Tutorial

Mexico Passport OCR with Python SDK

Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Mexico passports with a server-side integration.

Python · Passport
Country Tutorial

Malaysia Passport OCR with Python SDK

Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Malaysia passports with a server-side integration.

Python · Passport
Tutorial

Java Passport OCR API

Extract passport MRZ and VIZ data in Java. Upload an image for a free test! Our API provides structured JSON output, handling glare and blur automatically.

Java · Passport
Country Tutorial

Morocco Passport OCR with Node.js SDK

Use the official StructOCR Node.js SDK with TypeScript and Express to extract structured MRZ and VIZ data from Morocco passports.

Node.js · Passport
Country Tutorial

Mexico Passport OCR with Node.js SDK

Use the official StructOCR Node.js SDK with TypeScript and Express to extract structured MRZ and VIZ data from Mexico passports.

Node.js · Passport
Tutorial

Idaho Driver License & ID Card PDF417 API

Decode the PDF417 barcode on Idaho driver licenses and state ID cards into AAMVA JSON, with document_kind to tell licenses from ID cards.

Driver License

Technical Comparisons & Integrations

Explore platform integrations and competitive analysis

From tutorial to production in 5 minutes.

You've seen the code. Now get your API key, grab your 200 free credits, and see it work with your own images. No credit card required.

Instant Access Cancel Anytime No Credit Card