CNIC to text, free and online
Upload a photo, scan or PDF of a Pakistani CNIC and get its details back as text: the name, father's or husband's name, 13-digit CNIC number and dates. Copy the fields, or download them as Excel, CSV or JSON. It's free, with no account, and it reads what is printed rather than verifying the card.
- Free
- No sign-up, no card
- Download as Excel, CSV or JSON
A CNIC 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 identity card
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.
What you get when you convert a CNIC to text
Plain OCR gives you every word on the card in one block, in the order the scanner happened to find it, with Urdu and English mixed together. This tool returns each detail under its own name, so the CNIC number is in the CNIC number field and the expiry date is in the expiry field. That is what you need to paste into a form, a spreadsheet or your own system.
| Field | Where it is on the card | Example (invented) |
|---|---|---|
| Name | Front, in English and Urdu on most versions | Alex Sample |
| Father's or husband's name | Front | Sam Sample |
| CNIC number | Front, 13 digits as 00000-0000000-0 | 00000-0000000-0 |
| Gender, country of stay | Front | M, Pakistan |
| Date of birth | Front | 1990-01-01 |
| Date of issue, date of expiry | Front | 2024-01-01, 2034-01-01 |
| Present and permanent address | Back, mostly in Urdu | As printed |
How to convert a CNIC to text
- Photograph the card flat, in good light, with all four corners in frame and no glare across the number. A scan or a PDF works too.
- Upload the front. The free try reads one image or the first page of a PDF, so upload the back separately if you need the address.
- Check the fields against the card, especially names, since Urdu script is where a misread is most likely.
- Copy what you need, or use Download to save it as Excel (.xlsx), CSV or JSON.
Which Pakistani ID cards it reads
- CNIC, the green computerised national identity card, in its older and newer layouts.
- Smart NIC (SNIC), the chip card NADRA issues today, front and back.
- NICOP, the card for overseas Pakistanis, and the POC (Pakistan Origin Card).
- Juvenile cards and the B-Form (Child Registration Certificate), which is a printed page rather than a card.
- Photocopies and attested copies, as long as the number is still sharp.
Reading the CNIC number
The 13 digits are grouped 5-7-1. Under NADRA's numbering the first digit stands for the province or region where the card was registered, and the last digit is odd for men and even for women. The tool returns the number exactly as printed, with its dashes, so it pastes cleanly into a form that expects the 00000-0000000-0 pattern. If a form wants the digits only, remove the dashes after you paste.
CNIC to Excel for many cards
HR teams, landlords, microfinance and onboarding teams often have a folder of CNIC photos to type into a sheet. The free try handles one card at a time, 5 a day. A free account reads up to 100 pages a month, keeps every result, and exports them together, one row per card, to Excel or CSV. For a whole onboarding flow, see KYC onboarding.
Sample API call
This is how the same CNIC 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.
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"{
"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 CNIC
- Create a free account.
- Upload one sample under Workflows, keep the fields you want and save. That gives you a real workflow id.
- Create an API key under Settings. Keys are switched on per account, so ask us if you don't see the option.
- Set
DOCREFINERY_APIandDOCREFINERY_API_KEYas in the quickstart, and swap in your id.
Free try or free account?
| Feature | Free try | Free account |
|---|---|---|
| Pages read | Page 1 | Every page |
| Allowance | 5 tries a day | 100 pages a month |
| File size | Up to 10 MB | Up to 100 MB |
| How it reads | Finds the fields on the page | Built-in CNIC fields, or your own workflow |
| Checking | Compare with your page | Confidence scores and page citations |
| Output | Fields on screen, download as Excel, CSV or JSON | Excel, CSV and JSON for every page, and API keys on request |
Common questions
Is CNIC to text conversion free?
Yes. You get 5 free tries a day with no account and no card. Each try reads one image, or the first page of a PDF, and you can download the result as Excel, CSV or JSON.
Can it read the Urdu on a CNIC?
It tries to read every language printed on the card, including the Urdu name and the Urdu address on the back. Check Urdu names against the card, because that is where a misread is most likely.
Can I convert a CNIC to text from a phone photo?
Yes. A clear phone photo works as well as a scan. Lay the card flat, avoid glare on the number and keep the whole card in frame.
Can I get the front and back of a CNIC together?
The free try reads one side: one image, or the first page of a PDF. Upload each side in turn, or use a free account to read both pages of a PDF in one run.
Can I convert a CNIC to Excel?
Yes. After the try, choose Download, then Excel. The fields arrive on one sheet as Field and Value. A free account exports many cards at once, one row per card.
Is it safe to upload a CNIC?
A CNIC is sensitive personal data. Upload only your own card, or one you have permission to process. We keep the first page and the result for 7 days to run and improve the tool, then delete them.
Sources
Related
- ID card OCRFree ID card OCR for CNIC, Aadhaar, Emirates ID and national ID cards. Extract name, ID number and dates as structured data, with no account needed.
- 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.
- KYC and onboardingKYC document extraction for passports, ID cards, proofs of address and company records. Missing fields come back empty, never guessed. Not an ID check.
- Bank statement to ExcelConvert a bank statement PDF or scan to Excel free. Get balances and transactions as an XLSX with amounts as numbers, from any bank, no account needed.
Try it on your own CNIC.
Free, with no sign-up and no card.