OCR guide

How to Extract Text from an Aadhaar or PAN Card Photo Safely

Copy name, address and numbers from an Aadhaar, PAN or ID card photo into forms with OCR, while masking and protecting your personal data.

By the Ocr4you Team ยท

Filling the same details from an Aadhaar card, PAN card, voter ID or driving licence into form after form is tedious. Long addresses with house numbers, landmarks and PIN codes are easy to mistype, and a single wrong digit in a PAN can cause a rejected application. OCR can read the card photo and give you the text to copy. But ID cards contain exactly the kind of data that should be handled carefully. This guide shows how to extract text from an Aadhaar or PAN card photo, and how to do it in a way that protects your identity.

What you can extract, and what you should not need to

Typical reasons to OCR an ID card:

  • Copying a long address exactly as printed for a bank, rental agreement, school admission or utility connection form.
  • Getting the spelling of a name in English and Hindi to match across documents.
  • Typing a PAN, date of birth or father's name without errors.
  • Keeping a searchable text record of family members' details for your own use.

Before you start, ask what the form actually needs. Many places only need the last four digits of an Aadhaar number, and some only need the address. The less you extract and store, the less there is to leak.

Safety checklist before you upload anything

  • Use a masked Aadhaar where you can. The official masked Aadhaar from UIDAI shows only the last four digits of the number and is accepted for many purposes. Our guide on masking the Aadhaar number also explains how to hide digits yourself.
  • Crop to what you need. If you only need the address, crop the back side to the address block. Leave out the photo, QR code and number.
  • Use a trusted site over HTTPS. Check the padlock in the address bar and the correct domain. Avoid random apps that ask for gallery, contacts or SMS permissions just to read a card.
  • Do not share card images in group chats or public drives to "send them to yourself". Use a private note or direct transfer instead.
  • Delete what you no longer need. Remove card photos from your gallery, downloads folder and recent files once the job is done, and empty the "recently deleted" album.
  • Watermark any copy you hand over. When you must share a card image, add a watermark like "For XYZ Bank KYC only, 23-10-2026". See how to watermark ID copies for KYC.

Step by step: extract text from a card photo

  1. Place the card on a dark, plain surface in good daylight. Avoid flash, because the laminated surface reflects it.
  2. Take the photo from directly above so the card is a rectangle, not a trapezium. Fill most of the frame.
  3. Crop to the part you need, and cover or crop out the Aadhaar number if the form does not require it.
  4. Open Image to Text on Ocr4you and upload the image.
  5. Pick English for the English side. For the Hindi name and address on an Aadhaar, run it again with Hindi selected, or use Hindi Image to Text. Regional Aadhaar cards may have Tamil, Bengali, Marathi or other scripts; choose that language.
  6. Copy the text into your form and compare every character with the card.

If you received an e-Aadhaar PDF, it is password protected (the first four letters of your name in capitals plus your birth year). Open it, then take a screenshot of the address section or use PDF to Text on the unlocked copy. Our guide to the Aadhaar PDF password explains the format.

Checking the numbers

OCR is good at printed text, but ID numbers deserve a manual check, every time:

  • PAN format: a PAN has 10 characters: five letters, four digits, one letter (for example ABCDE1234F). The fourth letter shows the holder type, P for an individual. If OCR returns an O where a 0 should be, the pattern tells you.
  • Aadhaar format: 12 digits, printed in groups of four. It never starts with 0 or 1. Count the digits.
  • PIN codes: six digits. Check that they match the city and state.
  • Dates of birth: Indian cards use DD/MM/YYYY. Some forms want YYYY-MM-DD; reformat carefully.
  • Look-alikes: 0 and O, 1 and I, 5 and S, 8 and B are the usual swaps on small card fonts.

What OCR will not do

OCR reads the visible text. It does not verify that a card is genuine, and it cannot read the encrypted data in the secure QR code on newer Aadhaar cards. For verification, UIDAI's own services and the mAadhaar app are the right tools. Likewise, PAN details should be verified on the income tax e-filing portal, not by reading a photo.

Preparing card images for upload forms

Many government and exam portals ask for an ID card image under a specific size. After extracting the text, you may need to put both sides on one page with Aadhaar front and back on one page, reduce the file with Compress Image, or merge scans into a PDF. Keep the watermark on the shared copy and the clean original only in a secure place.

A note for shops, offices and agents

If you collect ID documents from customers, for example at a cyber cafe, CSC centre, rental office or SIM shop, you have extra responsibility under India's data protection rules. Only collect what is required, tell the customer why, do not keep copies longer than needed, and never reuse a customer's documents for anything else. Extracting text instead of storing full card images can actually reduce how much sensitive data you keep.

Frequently asked questions

Can I copy text from an Aadhaar card photo?

Yes. Upload a clear, cropped photo to Ocr4you Image to Text, choose English or Hindi, and copy the name and address. Always check numbers manually.

Is it safe to upload my Aadhaar or PAN card online?

Only share what you need. Use a masked Aadhaar, crop out the number and photo, use a trusted HTTPS site, and delete the images when you are done.

How do I check that the OCR read my PAN correctly?

A PAN has five letters, four digits and one letter. Compare each character with the card and watch for 0 and O or 1 and I swaps.

Can OCR read the QR code on an Aadhaar card?

No. OCR reads printed text only. The secure QR code holds signed data that is verified with UIDAI apps and services.

Can I extract the Hindi address from an Aadhaar card?

Yes. Crop the Hindi address block and convert it with Hindi selected, or use the Hindi Image to Text tool.

Try it now: Image to Text (OCR) is free to start and works on mobile and desktop.

Open Image to Text (OCR)

Related guides