Passport data extraction

Passport data extraction reads the data page of a passport from a scan or photo and returns the holder's details, dates and MRZ lines as structured fields. docRefinery's passport OCR API covers 26 field definitions, with confidence scores and page and box citations on extracted values. It reads what is printed. It does not verify that a passport is genuine, and it is not an identity check.

Updated

Where passport extraction fits in KYC

Compliance and onboarding analysts retype passport details into a case system so that screening and verification tools can run. Extraction replaces the typing and nothing after it. If you need to know that the person is real and the document unaltered, you need a dedicated identity verification provider alongside it. The KYC workload sets out the rest of the file, such as proofs of address.

Issuers are institutions, and they don't redesign often: a passport from one country is the same layout each time, so each is learned once and remembered. In KYC, a confident wrong answer is the worst outcome, which is why a field the passport doesn't contain stays empty.

Passport fields docRefinery extracts

All 26 definitions follow. There's no repeating table here, unlike most finance documents. Family names and address appear in some countries' passports and not in others, so expect null often.

The 26 passport field definitions, by category
CategoryFields
DocumentDocument Type Code, Passport Type, Passport Number, Issuing Country Code, Issuing Country Name
HolderSurname, Given Names, Full Name, Nationality, Date of Birth, Sex, Place of Birth, Personal Number
IssueDate of Issue, Date of Expiry, Issuing Authority, Place of Issue
Where the passport prints themFather Name, Mother Name, Spouse Name, Holder Address, Observations
Machine readable zoneMRZ Line 1, MRZ Line 2
Presence onlySignature Present, Photo Present

Signature Present and Photo Present say that something is there. They don't compare a face, match a signature or judge whether either is real.

Example passport JSON

A trimmed excerpt for an invented holder of Utopia, the fictional state ICAO uses in its specimens. The Extract a document page has the full response.

Excerpt: passport result
{
  "document_type": "passport",
  "result": {
    "fields": [
      { "alias": "Surname", "text": "SAMPLE", "field_confidence": 0.98,
        "location": { "page": 1, "bbox": [0.38, 0.18, 0.56, 0.21] } },
      { "alias": "Passport Number", "text": "S00000001", "field_confidence": 0.97,
        "location": { "page": 1, "bbox": [0.70, 0.12, 0.90, 0.15] } },
      { "alias": "Date of Expiry", "text": "2030-12-31", "field_confidence": 0.96,
        "location": { "page": 1, "bbox": [0.38, 0.58, 0.58, 0.61] } },
      { "alias": "Spouse Name", "text": null, "location": null },
      { "alias": "MRZ Line 1", "text": "P<UTOSAMPLE<<ALEX<<<<<<<<<<<<<<<<<<<<<<<<<<<", "field_confidence": 0.95,
        "location": { "page": 1, "bbox": [0.05, 0.84, 0.95, 0.89] } },
      { "alias": "MRZ Line 2", "text": "S000000017UTO9001011F3012316<<<<<<<<<<<<<<04", "field_confidence": 0.94,
        "location": { "page": 1, "bbox": [0.05, 0.90, 0.95, 0.95] } }
    ],
    "extraction_approval": "auto",
    "low_confidence_fields": []
  }
}

What docRefinery offers for passports

Volume is rarely the issue with passports. What counts is control of personal data and a clean handover to the case file.

Control over personal data

  • On-premises deployment. Enterprise runs in a private VPC or fully air-gapped on your own servers, on models inside your network, so a passport need not leave it. That is a deployment capability, not a compliance certificate.
  • Fewer fields, less exposure. Your organisation decides what may be extracted, so Father Name or Holder Address can stay switched off.
  • Retention you set. Terms run from 7 days on Starter to custom on Enterprise, and data is encrypted in transit and at rest.
  • Keys you can account for. API keys carry an expiry, can be revoked, and keep an activity log.

A clean handover to the case file

  • Your case system's names. A Return as alias sends Passport Number back as document_no, or whatever your form calls it.
  • One format across the file. Passports use the same field shape as bills and statements, so a single parser reads the whole KYC file.
  • Scripts beyond Latin. 70+ languages and scripts are supported, which matters when names print in national characters.
  • Form filling. Our Chrome extension runs a document and auto-fills a web form. It is in early access and not in the Chrome Web Store yet.

What makes passports hard to read

  • Two versions of the name. The printed zone may use national characters, while ICAO Doc 9303 limits the MRZ to a restricted set and truncates long names. A mismatch between Full Name and MRZ Line 1 is often normal.
  • A dense code. The two MRZ lines of 44 characters use < as filler, and a single misread 0 or O changes a document number.
  • Two-digit years. MRZ dates are written YYMMDD, so the century has to be inferred.
  • Glare and angle. Laminate reflects flash, and phone photos of an open booklet curve towards the spine.
  • Busy backgrounds. Security printing and guilloche patterns sit directly behind the text.
  • Every issuer differs. Layouts, field order, date styles and languages change by country, and some pages print labels in two or three languages.

How low-confidence passport values are handled

Thresholds are set per field, so Passport Number and Date of Birth can sit at the strict end while Observations stays relaxed. A value below its threshold marks the run human-approval and enters the review queue, where an analyst sees the value's box on the passport image and confirms or corrects it. Treat that queue as access to personal data, since reviewers see the document. Fields the passport doesn't print return null; nothing is inferred from nationality or the MRZ. A value's location also gives your audit trail a page and a position.

Common questions

Does docRefinery verify passports?

No. It extracts the printed fields and MRZ text. It doesn't check authenticity, detect forgery, read the chip, match a selfie or run liveness checks. Use an identity verification provider for those. Forgery and fraud detection is research on our roadmap, not a product.

Does the passport OCR API check MRZ check digits?

It returns MRZ Line 1 and MRZ Line 2 as read, each with a score. We make no claim of check-digit validation, so run that in your own process if you need it.

Is there a sample passport to test with?

No. The dashboard's samples are invoices, bills and similar. Test with a specimen or a document you have the right to process, not a customer's passport.

Can passports be processed without leaving our network?

Yes, on Enterprise, which supports private VPC and fully air-gapped on-premises deployment. Results keep the same format and your Return as field names wherever it runs. This is a deployment capability, not a compliance certificate, so your own lawful basis and access rules still apply.

Sources

  1. ICAO Doc 9303, Machine Readable Travel Documents
  2. ICAO Doc 9303 Part 4: machine readable passports

Related

Try it on your own documents.

Upload a real file and see each field with its confidence score, ready to check.

100 pages a month free. No credit card, no sales call.