Back to Blog
October 21, 202610 min read•DeepRead Team

Passport OCR API and Software: A Technical Guide

Passport OCR APIs and software compared: MRZ parsing, ICAO 9303 check digits, named vendors, use cases, and pricing.

passport-ocr-api-and-software

Passport OCR is a narrower, more specific problem than general document OCR. Almost everything that matters is concentrated in one small region of the page: the machine-readable zone, two monospaced lines printed across the bottom of the photo page, built to a published international standard that makes the whole thing self-verifying. This guide covers that standard, the three ways to implement passport OCR, named platforms across the market, and the real use cases and trade-offs driving purchasing decisions in this category.

Passport checks usually sit inside a broader identity verification pipeline of biometric matching, AML screening, and risk-based routing, which is mapped out in automated ID document verification with scanning. This piece is about the passport-specific layer underneath it.

Who This Is For

  • Developers building passport scanning into an app, whether for travel, onboarding, or identity verification.
  • Teams deciding between an open-source library, a hosted API, or hardware-grade equipment.
  • Anyone comparing named passport OCR vendors and needing to know which claims are verified versus third-party-reported.

The MRZ and the ICAO 9303 Standard

The machine-readable zone is defined by ICAO Document 9303, the international standard that keeps passport data readable the same way across every issuing country. Three layouts exist, and knowing which one you're dealing with determines how parsing works:

  • TD3, the standard passport booklet format: two lines, 44 characters each.
  • TD2: two lines, 36 characters each.
  • TD1, used for passport cards and some national ID cards: three lines, 30 characters each.

Every field in the MRZ sits at a fixed character offset within its line, defined by the standard. Once you have two (or three) clean lines of correctly recognized monospaced text, extracting the individual fields- document number, surname, given names, nationality, dates- is pure string slicing; no machine learning required for that step.

Why a Passport MRZ Is Self-Validating

This is the single most useful fact about passport OCR, and it's what separates it from reading a general document: every key field in the MRZ carries its own check digit, a single character calculated from the field's contents using a weighting algorithm defined in the standard. A system can run that same algorithm over the OCR-recognized text and compare the result to the printed check digit, confirming the field was read correctly through arithmetic, not by trusting the OCR output on faith.

There's also a composite check digit validating the MRZ as a whole, beyond the individual field checks. A real hosted passport OCR service documents exactly this mechanism, reporting dedicated flags for whether the passport number, birth date, and expiry date each individually satisfy their check digit, alongside a separate flag for whether the full MRZ agrees with its composite check digit.

One documented improvement on this specific service moved its rate of fully check-digit-verified reads, meaning number, birth date, and expiry all verified together, from 58.6% to 95.5% on a 266-passport benchmark, with every MRZ in that set parsing successfully. That's a meaningful, concrete illustration of what "good" looks like for this specific metric, and a reminder that raw parse success and full check-digit verification are different claims worth asking about separately. Check digits are one example of a deterministic validation signal, and confidence scores and fallback routing play the same role for fields that have no built-in checksum.

Three Ways to Implement Passport OCR

Open-source libraries (build it yourself)

You run OCR locally (commonly Tesseract, or a PaddleOCR-based pipeline), crop to the MRZ region, and run the ICAO 9303 parsing and check-digit logic yourself, either hand-written or through a dedicated library.

  • OmniMRZ, an open-source Python library, combines OCR, structural validation, checksum verification, and logical consistency checks specifically for MRZ extraction, supporting TD1, TD2, and TD3 format detection automatically and including OCR-error-tolerant digit correction for common recognition mistakes (O read as 0, S read as 5, B read as 8).
  • IronOCR/IronTesseract, demonstrated directly in a published implementation guide, handles the raw OCR recognition step, with MRZ parsing and ICAO 9303 check-digit validation left as deterministic logic the developer owns directly.
  • The mrz Python library is used in at least one open-source reference implementation specifically for checksum validation after Tesseract performs recognition.

The genuine advantage of this path, stated directly in one implementation guide: the sensitive decoding steps stay inside your own code and infrastructure, and OCR runs locally rather than sending passport images to a third-party API at all.

Hosted APIs

A managed service handles capture, recognition, parsing, and check-digit validation, returning structured fields and verification flags over an API call.

  • One documented hosted passport OCR API reports a median processing time of 0.4 seconds per passport, returns the holder's biographic fields alongside the face photograph, and exposes explicit valid_* flags per field plus an overall valid_score reporting what percentage of check digits were successfully verified, letting a calling application make its own decision about how much verification confidence to require before accepting a read.

Hardware-grade SDKs

Built for in-person verification at a border crossing, a kiosk, or a secure facility, these go beyond MRZ OCR into physical document authentication.

  • Regula's Document Reader SDK reads MRZ, RFID chip data, and barcodes together, performing cross-checks between them, and states compliance with ICAO 9303, ISO 18013, and BSI TR-03105. It specifically supports MRZ recognition under infrared and white light, and checks physical security properties like UV dull paper luminescence and MRZ print contrast against ICAO 9303 and ISO 7501-defined ink standards, checks that only make sense with dedicated capture hardware, not a phone camera.

Passport-Specific Challenges General OCR Guidance Doesn't Cover

  • Holograms and watermarks interfere with recognition directly. One open-source implementation names this explicitly: watermarks and holograms, the very security features meant to prevent counterfeiting, can visually overlap the MRZ area and interfere with OCR, a tension unique to security-printed documents.
  • Two-digit years don't encode the century. MRZ dates are printed as two-digit years by design, per the ICAO 9303 standard, meaning the raw MRZ data alone can't distinguish 1965 from 2065 for a birth date without additional logic applied on top.
  • Common monospace OCR misreads are predictable and correctable. The MRZ font is designed to be machine-readable, but certain character pairs (O/0, S/5, B/8) still get confused by OCR engines not specifically tuned for it, which is exactly why dedicated MRZ libraries build in targeted correction rules rather than relying on general-purpose OCR accuracy alone.
  • Raw MRZ parse success and check-digit verification are different claims. A system can successfully extract text that looks like an MRZ while still failing check-digit validation, meaning the OCR output is actually wrong in a way that arithmetic catches but simple text extraction wouldn't.

Use Case Names

Passport OCR shows up as a named pain point in several concrete business contexts, not just as a general capability:

  • Financial account opening. Manual passport verification is cited as a direct cause of abandoned applications during onboarding, with real per-abandonment cost figures circulating in vendor materials.
  • Hospitality check-in. Manual verification at the front desk creates lobby bottlenecks and delays, a named use case for real-time mobile OCR specifically.
  • Employment and I-9 compliance. Verifying work-authorization documents for new hires, where delayed verification pushes back start dates.
  • Airport and border processing. Validating passport authenticity to keep boarding and border queues moving; the use case Regula's hardware-grade SDK is built around.
  • Government citizen services. Processing identity documents for public-sector service delivery at volume. Casework teams handling immigration filings, where passports are a core document, can look at DeepRead's immigration solution page for how it approaches that document flow.
  • Insurance claims and fraud investigation. Validating passport authenticity and cross-referencing against watchlists during claims review, where fraud specifically exploits slow manual verification.

Named Platforms

A note on how to read this list: several entries below come from third-party comparison sites rather than each vendor's own pages, flagged individually. Verify current pricing and capability directly.

Mindee offers a dedicated passport OCR API extracting structured data (name, ID number, expiry, country, MRZ) from any international passport layout, with a 14-day free trial and tiered pricing based on volume. Its own site states accuracy is generally above 95% for most fields.

Veryfi markets a US-specific Passport OCR API, positioned explicitly around PATRIOT Act compliance and onboarding speed, bundled with free SDKs and a no-code portal for document management and model fine-tuning.

Regula (Document Reader SDK) is the hardware-grade option covered in the MRZ section above, for in-person verification requiring physical document authentication alongside OCR.

Apify's Passport OCR Actor, built on Azure, prices at $0.005 per successful result (roughly $20 per 1,000), a genuinely transparent, usage-based rate for low-friction testing.

Eden AI is an aggregator rather than a single OCR provider, routing requests across multiple underlying passport/ID parsing APIs with per-request billing and provider redundancy, useful if you want to avoid single-vendor lock-in rather than commit to one engine.

Google Cloud Vision, Azure Document Intelligence, and AWS Textract are general-purpose cloud OCR platforms with passport or ID-document capability as one feature among many, rather than a passport-specific product. Azure's own documentation is credited with strong prebuilt passport models by one comparison.

Tesseract OCR (self-hosted, free) paired with a dedicated MRZ parsing library (OmniMRZ or similar) is the fully open-source path, covered in more technical detail above.

The following are named repeatedly in third-party "best of" comparisons but weren't independently verified against their own sites for this piece: Pixl.ai/Pix Dynamics (cloud and on-prem, positioned for regulated banking), KBY-AI (enterprise SDK, quote-based pricing starting around $3,000+ per seat), BlinkID by Microblink (automatic template recognition across 2,000+ document types), Anyline (real-time mobile MRZ scanning SDK), Jumio, Onfido, Sumsub, and HyperVerge (broader identity verification platforms with passport OCR as one component, already covered in more depth in our automated ID document verification guide.

Country-Specific Considerations

Passport OCR accuracy isn't uniform across issuing countries, and one comparison names this directly: passports using non-Latin scripts in their visual (non-MRZ) zone- Devanagari text on Indian passports is the cited example- require multilingual OCR capability specifically for the visual zone, separate from MRZ parsing, which stays Latin-character-only by design across all ICAO 9303-compliant documents regardless of issuing country. If your volume concentrates on specific countries, confirm a vendor's accuracy claims were actually tested against that country's passport format, not just the MRZ in general.

Free vs. Paid: A Real Decision Point

Genuinely free, unlimited passport OCR is rare, a point made directly in one comparison. The realistic free options are a self-hosted Tesseract-plus-MRZ-parser pipeline (free but requires you to own the OCR error correction and validation logic) or a vendor's limited free tier (useful for testing, not production volume). Paid options range from transparent per-result pricing (Apify's $20/1,000) to enterprise quote-based licensing running into thousands of dollars per year, with the difference typically tracking how much verification depth (check-digit validation, physical document authentication, fraud screening) is bundled in beyond raw MRZ reading. How usage-based and contract pricing differ across identity verification vendors more broadly is broken down in pay-as-you-go document validation tools.

Conclusion

Passport OCR sits on two different kinds of content: the mechanism (MRZ structure, check-digit validation defined by ICAO 9303) and the market (named vendors spanning free self-hosted libraries, developer-focused APIs like Mindee and Veryfi, aggregators like Eden AI, and enterprise hardware-grade SDKs like Regula). Named use cases, account onboarding, hospitality, employment compliance, border processing, government services, and insurance fraud, drive most of the real purchasing decisions in this category, and country-specific script requirements and free-versus-paid trade-offs are concrete, practical factors worth checking before committing to one path.

FAQ

What is the MRZ on a passport?

The machine-readable zone, two monospaced lines printed across the bottom of a passport's photo page, defined by the ICAO 9303 standard, encoding the holder's key biographic data (name, number, nationality, dates) in a fixed, consistent format readable by both machines and the check-digit algorithm defined in the standard.

What's the difference between TD1, TD2, and TD3 MRZ formats?

TD3 is the standard passport booklet format: two lines of 44 characters. TD2 is two lines of 36 characters. TD1, used for passport cards and some national ID cards, is three lines of 30 characters. Each format places fields at different fixed offsets.

How does a passport MRZ check digit actually work?

Each key field carries a check digit calculated from that field's contents using a weighting algorithm defined in ICAO 9303. A system runs the same algorithm over the recognized text and compares the result to the printed check digit, verifying the read is correct arithmetically rather than trusting OCR output without a way to check it.

Is there a genuinely free passport OCR option?

A self-hosted combination of Tesseract and a dedicated MRZ parsing library (like OmniMRZ) is free and open-source, though it requires you to own OCR error correction and validation logic yourself. Truly unlimited free hosted options are rare; most vendor free tiers are limited to low volume for testing.

Does passport OCR accuracy vary by issuing country?

Yes, particularly for the visual (non-MRZ) zone. Passports using non-Latin scripts there, Devanagari on Indian passports is a cited example, require multilingual OCR capability specifically, separate from MRZ parsing, which stays Latin-character-only across all ICAO 9303-compliant passports regardless of country.

Does DeepRead support passport OCR?

No, passports aren't among DeepRead's eight published, benchmarked document types, and it doesn't perform MRZ parsing or check-digit validation, which are the core mechanisms this category depends on.