Use case · Indian identity documents

Aadhaar and PAN card OCR API

Aadhaar and PAN OCR with Mahad OCR reads Indian identity cards and returns the card number, name, date of birth and other printed fields as JSON. A full 12-digit Aadhaar number is checked with its Verhoeff check digit and a PAN is checked against its 10-character format — both as evidence that the number was read correctly, never as proof the card is valid.

Fields returned

KeyWhat it holds
id_numberAadhaar: 12 digits (masked Aadhaar is returned as printed). PAN: 10 characters
full_nameAs printed
date_of_birthISO date where printed (some Aadhaar cards print only a year of birth)
sexWhere printed

How ✓ and ⚠ work here

  • Aadhaar: a full 12-digit number from an Indian card is checked with the Verhoeff algorithm (aadhaar_check_digit).
  • PAN: the number must match five letters, four digits, one letter (pan_structure).
  • These are L1 structure checks — they show the number was read consistently with its format, nothing more.
  • ⚠ Single-reader or disputed values are marked for a person to check.

Example request and response

Fictional data, real response shape (trimmed to the keys that matter here). Full field list in the API reference.

curl -X POST https://api.mahadocr.com/v1/documents/upload \
  -H "X-MahadDoc-API-Key: mk_live_YOUR_KEY" \
  -F "[email protected]"

# 202 Accepted
# { "id": "DOC_3f9a1c7e2b40", "status": "processing", ... }

curl https://api.mahadocr.com/v1/documents/DOC_3f9a1c7e2b40 \
  -H "X-MahadDoc-API-Key: mk_live_YOUR_KEY"
{
  "id": "DOC_3f9a1c7e2b40",
  "status": "verified",
  "result": {
    "status": "verified",
    "decision": "verified",
    "document_type": "aadhaar",
    "values": {
      "id_number": "2345 6789 0124", "full_name": "RAVI SPECIMEN TESTKUMAR",
      "date_of_birth": "1990-04-15", "sex": "Male"
    },
    "verification": {
      "evidence": [
        { "level": "L1", "rule": "aadhaar_check_digit", "result": "passed", "fields": ["id_number"] }
      ]
    }
  }
}

Limits

  • Evidence only: Mahad OCR does not contact UIDAI, the Income Tax Department or any Indian government system, and does not perform Aadhaar authentication or e-KYC.
  • A masked Aadhaar (only the last 4 digits shown) cannot be check-digit tested; it is returned as printed.
  • A full Aadhaar number is returned as read — the API does not mask it. Mask or discard it in your own system if your process does not need the full number.
  • Aadhaar numbers are sensitive personal data. Store only what your process needs; you can delete a document through the API (DELETE /v1/documents/{id}) and set a retention period.
  • Files: PNG, JPG, PDF or Word, up to 10 MB.

Frequently asked questions

Does Mahad OCR verify an Aadhaar number with UIDAI?

No. It checks the Verhoeff check digit of a full 12-digit number read from the card. That shows the digits were read consistently; it does not show the number is issued or active.

What PAN checks are done?

The number must match the PAN format: five letters, four digits and a final letter. There is no lookup against the Income Tax Department.

Can it read masked Aadhaar?

Yes, the number is returned as printed. The check digit cannot be tested on a masked number.

Can I use this for KYC?

You can use the extracted fields in your own KYC process. Mahad OCR is not a KYC provider and does not decide whether a person passes KYC.

Is Mahad OCR an Indian company?

Yes. Mahad OCR is built and operated by Mahad Information Technology Private Limited, registered in Mulund, Mumbai, India. See the India page for data handling and plans.

Do Indian recruitment agencies use this with passports and CVs?

The same API reads Aadhaar, PAN, Indian passports (with MRZ check digits) and CVs, so an agency can read a candidate’s documents in one integration. Each document is still a separate upload.

How do I delete Aadhaar data after reading?

Call DELETE /v1/documents/{id}. The file, every version and the extracted fields are erased; only a minimal deletion record (id, company, time, who) is kept.

Related