Reading passports and national IDs with OCR
21 Jun 2026·Mahad OCR·3 min read
Identity documents are the most common thing teams need to digitise — for onboarding, recruitment, KYC and travel. OCR reads them in seconds and validates the data automatically.
Passports: the MRZ is your friend
Every passport has a Machine-Readable Zone (MRZ) — the two lines of characters at the bottom. Mahad OCR parses the MRZ and validates its ICAO check digits, so you get the surname, given names, passport number, nationality, date of birth, sex and expiry with high confidence — and it runs free, on-server (no per-document AI cost).
National IDs, any country
- Qatar ID (QID) and UAE Emirates ID
- Indian Aadhaar and PAN cards
- Driving licences and residence permits
For documents without an MRZ, the engine uses AI vision to detect the document type and extract the right fields — name, ID number, date of birth, expiry — with a confidence score on each.
Built-in fraud checks
Every upload runs a 5-check tamper panel (EXIF, MRZ checksum, error-level analysis, background noise, and re-upload detection) and returns a tamper score, so photoshopped IDs are flagged before a human sees them.
curl -X POST https://api.mahadocr.com/v1/documents/upload \ -H "X-MahadDoc-API-Key: YOUR_KEY" \ -F "file=@document.jpg" # poll the result curl https://api.mahadocr.com/v1/documents/DOC_xxx \ -H "X-MahadDoc-API-Key: YOUR_KEY"
Try Mahad OCR on your own documents
Sign up free, get an API key, and read your first document in minutes — passports, IDs, invoices, statements and more.
Get your API key or try the live demo →