Free passport OCR and MRZ extraction

Upload the data page of a passport and extract the name, passport number, dates and MRZ lines as structured data, free. It reads scans and phone photos of passports from any country. It reads what is printed, and it does not check that a passport is genuine.

Upload your passportTake a photo or pick a PDF, up to 10 MB
  • Free
  • No sign-up, no card
  • Download as Excel, CSV or JSON

A passport is sensitive personal data. Upload your own, or one you have permission to use. We keep the first page and the result for 7 days to run and improve this tool, then delete them. The rest of your file is not stored. Privacy policy

Sample. Every value is invented.

Republic of Sampleland

Passport

Surname
SAMPLE
Given Names
ALEX
Passport Number
XX0000000
Date of Birth
1990-01-01
Date of Expiry
2034-01-01
Nationality
SAMPLELANDER
{
  "surname": "SAMPLE",  "given_names": "ALEX",  "passport_number": "XX0000000",  "date_of_birth": "1990-01-01"}
  • Any layout, no template

    It works out the fields from the page itself, so there's nothing to set up.

  • Scans and phone photos

    Digital PDFs, scanned pages and photos all go through the same way.

  • Structured, not just text

    Named fields and table rows you can download as Excel, CSV or JSON, not a wall of OCR text.

  • An API when you need it

    The same data from your own code, as the sample call further down shows.

What the free passport extractor reads

  • Holder: surname, given names, nationality, sex, date and place of birth.
  • Passport: passport number, type, issuing country and issuing authority.
  • Dates: date of issue and date of expiry.
  • MRZ: both machine-readable lines at the foot of the page, exactly as printed.
  • Local fields where a country prints them, such as a national ID number or a parent's name.

Passports and travel documents by region

Most passports follow the same international layout, which is why the MRZ looks alike everywhere. The details around it are where countries differ.

Passport types and what each adds
RegionDocumentWhat to look for
PakistanPakistani passport, machine-readable passport (MRP), e-passportCNIC number, father's or husband's name
IndiaIndian passport, e-passportFile number, parents' and spouse's names on the last page
BangladeshBangladeshi e-passport, MRPPersonal number
UAE, Saudi Arabia, GulfPassport with Arabic and English textNames in two scripts
United Kingdom, IrelandBritish or Irish passportAuthority, biometric chip symbol
European UnionReisepass, passeport, pasaporteText in several languages
United States, CanadaUS or Canadian passport, passport cardPlace of birth by state or province
WorldwideDiplomatic, official and service passportsPassport type code in the MRZ

How to get a clean passport read

  • Upload the page with the photo. That's where the fields and the MRZ are.
  • Keep all four corners in frame, and include both MRZ lines at the bottom.
  • Avoid glare from the laminate: tilt the passport away from the light.
  • Some passports print extra details on a second page. A free account reads every page of a PDF.

The passport field list covers all 26 fields, and KYC onboarding shows where passport extraction fits in a client file.

Sample API call

This is how the same passport looks from your own code. wf_demo_passport is a dummy workflow id and every value below is invented, so the call won't run as written. A real run reads every page and adds a confidence score and page position to each field.

Run a workflow, then read the result
curl -X POST "$DOCREFINERY_API/v1/workflows/wf_demo_passport/run" \
  -H "Authorization: Bearer $DOCREFINERY_API_KEY" \
  -F "[email protected]"

# Take trace_id from the answer, then poll until status is "fulfilled"
curl "$DOCREFINERY_API/v1/runway/9f1c0a7e" \
  -H "Authorization: Bearer $DOCREFINERY_API_KEY"
Response (invented values)
{
  "trace_id": "9f1c0a7e",
  "status": "fulfilled",
  "document_type": "passport",
  "result": {
    "fields": [
      {
        "key": "surname",
        "alias": "Surname",
        "text": "SAMPLE",
        "field_confidence": 0.99,
        "location": { "page": 1, "bbox": [0.08, 0.12, 0.46, 0.14] }
      },
      {
        "key": "given_names",
        "alias": "Given Names",
        "text": "ALEX",
        "field_confidence": 0.98,
        "location": { "page": 1, "bbox": [0.08, 0.17, 0.46, 0.19] }
      },
      {
        "key": "passport_number",
        "alias": "Passport Number",
        "text": "XX0000000",
        "field_confidence": 0.97,
        "location": { "page": 1, "bbox": [0.08, 0.22, 0.46, 0.24] }
      }
    ],
    "extraction_approval": "auto",
    "low_confidence_fields": []
  }
}

Make it run on your own passport

  1. Create a free account.
  2. Upload one sample under Workflows, keep the fields you want and save. That gives you a real workflow id.
  3. Create an API key under Settings. Keys are switched on per account, so ask us if you don't see the option.
  4. Set DOCREFINERY_API and DOCREFINERY_API_KEY as in the quickstart, and swap in your id.

Free try or free account?

Free try and free account, compared
FeatureFree tryFree account
Pages readPage 1Every page
Allowance5 tries a day100 pages a month
File sizeUp to 10 MBUp to 100 MB
How it readsFinds the fields on the pageBuilt-in passport fields, or your own workflow
CheckingCompare with your pageConfidence scores and page citations
OutputFields on screen, download as Excel, CSV or JSONExcel, CSV and JSON for every page, and API keys on request

Common questions

Can I read a passport MRZ for free?

Yes. Upload the data page and the two MRZ lines come back as fields alongside the name, number and dates. You get 5 free tries a day with no account or card.

Does passport OCR work on a phone photo?

Yes, if the whole page is in focus and free of glare. The MRZ uses small characters, so a sharp photo matters. Check the passport number against the page before you use it.

Is there a passport OCR API?

Yes. The passport is a built-in document type with 26 fields, and a free account can run it through a saved workflow or the runway. API keys are switched on per account.

Do you verify that the passport is real?

No. docRefinery reads what is printed. It doesn't check authenticity, read the chip or compare the photo with a person. Use a dedicated identity verification provider for that.

Related

Try it on your own passport.

Free, with no sign-up and no card.