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.
| Category | Fields |
|---|---|
| Document | Document Type Code, Passport Type, Passport Number, Issuing Country Code, Issuing Country Name |
| Holder | Surname, Given Names, Full Name, Nationality, Date of Birth, Sex, Place of Birth, Personal Number |
| Issue | Date of Issue, Date of Expiry, Issuing Authority, Place of Issue |
| Where the passport prints them | Father Name, Mother Name, Spouse Name, Holder Address, Observations |
| Machine readable zone | MRZ Line 1, MRZ Line 2 |
| Presence only | Signature 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.
{
"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 misread0orOchanges 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
Related
- Passport OCRFree passport OCR. Extract the name, passport number, dates and MRZ lines from a scan or photo as structured data, with no account or card needed.
- On-premises extractionWhat on-premises and air-gapped document extraction really mean, the options available today, how to evaluate them, and the questions to ask every vendor.
- Use casesWhere document extraction fits best: accounts payable, lending, KYC, insurance claims, logistics, healthcare admin and contracts, wherever senders repeat.
- Utility billExtract meters, consumption, charges and service address from electricity, gas and water bills. An OCR API with scores and page box citations on values.
- Confidence scoresWhat a confidence score in document extraction means, how to set thresholds per field, when to send values to human review, and why null beats a guess.
- docRefinery vs AWS TextractdocRefinery vs Amazon Textract: an OCR service inside AWS against a finished extraction workflow with review. Features, compliance and pricing compared.
- Extract a documentExtract data from an invoice with the docRefinery API: submit with curl, Python or JavaScript, poll the run, then read fields, tables and low-confidence flags.
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.