Free ID card OCR for CNIC, Aadhaar and national IDs

Upload an identity card and extract the name, ID number and dates as structured data, free. It reads Pakistan's CNIC, India's Aadhaar and national ID cards from around the world, from a scan or a phone photo. It reads what is printed, and it does not verify the card.

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

An ID card is sensitive personal data. Upload your own, or one you have permission to use. Cover any number you don't need. 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

National Identity Card

Full Name
Alex Sample
Father Name
Sam Sample
Identity Number
00000-0000000-0
Date of Birth
1990-01-01
Date of Issue
2024-01-01
Date of Expiry
2034-01-01
{
  "full_name": "Alex Sample",  "father_name": "Sam Sample",  "national_identification_number": "00000-0000000-0",  "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.

Identity card names by country

An identity card is the same kind of document everywhere, but almost every country has its own name for it. If yours isn't listed, upload it anyway: the tool works out the fields from the card itself, in the card's own layout.

National and resident ID cards, by region
CountryCard namesNumber on the card
PakistanCNIC, Smart NIC (SNIC), NICOP, POC, from NADRA13 digits, written 00000-0000000-0
IndiaAadhaar card, PAN card, Voter ID (EPIC)Aadhaar 12 digits, PAN 10 characters
BangladeshNID, Smart NID card10 or 17 digits
Sri Lanka, NepalNIC, Nagarikta citizenship certificateVaries by card
UAEEmirates ID15 digits, starting 784
Saudi ArabiaNational ID (Hawiya), Iqama resident card10 digits
Qatar, Kuwait, OmanQID, Civil ID, Resident cardVaries by card
Malaysia, SingaporeMyKad, NRIC, FINMyKad 12 digits, NRIC 9 characters
Indonesia, PhilippinesKTP, e-KTP, PhilID (PhilSys), UMIDNIK 16 digits on a KTP
Nigeria, Ghana, KenyaNIN slip, Ghana Card, Huduma or Maisha cardNIN 11 digits
South Africa, EgyptSmart ID card, Egyptian national ID13 digits, 14 digits
TurkeyT.C. Kimlik card11 digits
Germany, France, ItalyPersonalausweis, Carte nationale d'identité, CIEVaries, with a machine-readable zone
Spain, Latin AmericaDNI, NIE, cédula, RG, CURP, INE credentialVaries by country
United States, CanadaState ID card, Green Card, provincial photo cardVaries by state or province

What the free ID card extractor reads

  • Identity: full name, surname, given names, and the name in local script where printed.
  • Family: father's, husband's or mother's name, which cards such as the CNIC carry.
  • Numbers: national ID number, card number and machine-readable zone lines.
  • Dates: date of birth, date of issue and date of expiry.
  • Details: sex, nationality, place of birth, address and issuing authority.

CNIC OCR: reading a Pakistani identity card

A CNIC prints the holder's name and father's or husband's name, the 13-digit number, and the dates of birth, issue and expiry. Depending on the card version, the front carries English, Urdu or both, and the addresses sit on the back. Upload it as a clear photo with the whole card in frame. For a Smart NIC, the same applies. For a step-by-step guide to the CNIC fields, see CNIC to text.

Aadhaar OCR: reading an Indian identity card

An Aadhaar card prints the name, date of birth, sex and 12-digit number on the front, with the address on the back. A printed e-Aadhaar puts both on a single page. If you don't need the full number, use a masked Aadhaar, which shows only the last four digits. A PAN card or Voter ID reads the same way.

Front and back of the card

Many cards split the details across two sides, so the number can sit on the front and the address on the back. The free try reads one side: the first page of a PDF, or a single image. Upload the side you need, or use a free account to read both together in one run.

Sample API call

This is how the same ID card looks from your own code. wf_demo_identity_card 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_identity_card/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": "identity_card",
  "result": {
    "fields": [
      {
        "key": "full_name",
        "alias": "Full Name",
        "text": "Alex Sample",
        "field_confidence": 0.99,
        "location": { "page": 1, "bbox": [0.08, 0.12, 0.46, 0.14] }
      },
      {
        "key": "father_name",
        "alias": "Father Name",
        "text": "Sam Sample",
        "field_confidence": 0.98,
        "location": { "page": 1, "bbox": [0.08, 0.17, 0.46, 0.19] }
      },
      {
        "key": "national_identification_number",
        "alias": "Identity Number",
        "text": "00000-0000000-0",
        "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 ID card

  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 ID card 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 extract CNIC data for free?

Yes. Upload a photo or scan of a CNIC and the tool returns the name, 13-digit number and dates as structured fields. You get 5 free tries a day with no account or card.

Does the Aadhaar OCR work with a masked Aadhaar?

Yes. It reads what is printed, so a masked Aadhaar returns the masked number as it appears. If you don't need the full number, a masked copy is the better one to upload.

Is there a CNIC or Aadhaar OCR API?

Yes. A free account lets you save a workflow for your card and run it through the API. The identity card is a built-in document type with 26 fields, and keys are switched on per account.

Can it read Urdu, Arabic or Hindi on an ID card?

It tries to read every language printed on the card, and the identity card fields include a name in local script. Check the result against the card, especially for names, since local scripts are where a misread is most likely.

Is it legal to upload someone else's ID card?

An ID card is sensitive personal data, and the rules depend on where you are. Upload only your own card, or one you have a lawful reason and permission to process. We keep the first page and result for 7 days, then delete them.

Sources

  1. NADRA, Pakistan's national identity authority
  2. UIDAI, India's Aadhaar authority

Related

Try it on your own ID card.

Free, with no sign-up and no card.