← All guides

Aadhaar masking: how to mask Aadhaar numbers in the copies your team stores

Loan files, onboarding folders, HR records and support tickets fill up with Aadhaar copies. Most of the teams holding them do not need the full number. This guide covers what masking means, why the rules push you toward it and how to mask a copy so the number is gone from every layer, not only the one you can see.

THE SHORT ANSWER

Aadhaar masking hides the first eight digits of a 12-digit Aadhaar number and shows only the last four, as in XXXX XXXX 1234. Teams that keep Aadhaar copies should mask the number in the image and the OCR text, check detections with the Verhoeff check digit, and treat the QR code as personal data too.

How this page was written. GritWorks makes GritRedact, GritTransform and GritRender, so we are not neutral. What we say about other products reflects their own public websites and documentation as of 20 November 2026. We make no claims about other products' accuracy. Products change: confirm details with each vendor.

Where an Aadhaar number hides in a stored copy

Masking only the digits you can see on the card leaves the number readable elsewhere. Check every place below before calling a copy masked.

LocationWhy it mattersWhat to do
Printed number on the frontThe obvious place, often printed in large digitsReplace the first eight digits with a solid fill in the image itself
Repeated number on letters and e-AadhaarAadhaar letters and e-Aadhaar PDFs can print the number more than once, and may also show a 16-digit Virtual ID (VID)Find every occurrence on every page, including the VID
QR codeCarries demographic data, and on newer documents a photo, in machine-readable formMask or remove it unless your workflow verifies it; see the QR section below
PDF text layer and OCR outputA searchable PDF or an OCR result can hold all 12 digits even when the image is coveredMask the text as well as the pixels, then re-run OCR on the output to confirm
Derived copiesThumbnails, previews, search indexes, logs, email attachments and exports keep their own copyMask at intake, before copies are made, and purge the unmasked original if you are not permitted to keep it
File names and metadataScans are often saved as the number itself, and form fields or metadata can repeat itRename files and strip metadata and form fields

What Aadhaar masking means

An Aadhaar number has 12 digits. A masked Aadhaar hides the first eight and leaves the last four visible, written as XXXX XXXX 1234. UIDAI offers a masked version of e-Aadhaar for download that follows the same pattern, and many organisations apply it to the copies they collect.

The last four digits are kept on purpose: they let a person or an agent match a document to a customer record without exposing the whole number. Masking is a form of partial redaction. Everything except those four digits should be removed so it cannot be recovered, not just covered. For the general difference between masking, redaction and flagging, see the PII redaction and PII masking guide.

Why UIDAI rules restrict storing full Aadhaar numbers

The Aadhaar Act, 2016 and the regulations and circulars issued by UIDAI limit who may collect, store and share Aadhaar numbers, and for what purpose. Read generally, they say:

  • The full number should not be published or displayed. The Act and its regulations restrict displaying or sharing Aadhaar numbers except as they allow, and core biometric information may not be shared at all.
  • Only entities with a legal basis should store full numbers. UIDAI requires entities that are permitted to store Aadhaar numbers to keep them in a separate, encrypted and access-controlled Aadhaar Data Vault, referred to elsewhere by a reference key or token.
  • Everyone else should keep less. Organisations that only need to see that a person holds an Aadhaar, or to match a record, are generally expected to keep a masked copy or no copy, not the full number.

Aadhaar numbers are also personal data under India’s data protection law, so purpose limitation, retention and security duties apply to every copy. See the DPDP Act and DPDP Rules guide.

Which rules bind you depends on the kind of entity you are and why you hold the copy. Check the current Act, regulations and UIDAI circulars, and your own counsel, for your case.

Mask the image and the OCR text, not one of them

  • Pixels. Replace the digits with a solid fill and flatten the result. Blurring or pixelating digits can leave them legible, and an annotation drawn on top of a PDF can be lifted off.
  • Text. Searchable PDFs, OCR results, extracted JSON and search indexes carry the digits as text. Replace the first eight digits there too, in the same pass, so the image and the text agree.
  • Verify. Run OCR on the masked output and search it for 12-digit sequences. If one survives, the copy is not masked.

GritRedact detects and permanently redacts sensitive values in documents and images, including ID cards and photographed documents, with pixel-level redaction inside your environment. Test it, like any tool, on your own document types first.

Validate detections with the Verhoeff check digit

Not every 12-digit number on a page is an Aadhaar number. Bank account numbers, reference numbers and phone numbers with prefixes can match a simple pattern. The last digit of an Aadhaar number is a Verhoeff check digit, which lets a detector reject most false matches.

  • How it works. The Verhoeff scheme processes the digits from right to left, permutes each digit according to its position and combines them with the multiplication table of the dihedral group D5. A number is consistent when the result is zero. It catches every single-digit error and every swap of two adjacent digits.
  • Use it as a filter, not proof. Roughly one in ten random 12-digit numbers passes the check by chance, so combine it with the format (Aadhaar numbers do not start with 0 or 1), the grouping into blocks of four, and context such as an “Aadhaar” or “आधार” label nearby.
  • Decide what to do with failures. A number that fails the check may be an OCR misread of a real Aadhaar number. In stored copies, mask on the label and layout as well, so one misread digit does not leave a number exposed.

A passing check digit says a number is well formed. It does not say the number exists, belongs to the person on the document or has been verified.

Scans, phone photos and QR codes

  • Scans and photocopies. Low contrast, speckle and photocopy noise make digits harder to read, so OCR may miss or misread the number. Test detection on degraded copies, not only clean PDFs.
  • Phone photos. Customers photograph cards at an angle, in poor light, with glare on laminated surfaces and fingers over the edges. Detection has to find the number on a skewed, partly hidden card, and the fill has to follow the card’s perspective.
  • Both sides. Copies often include the back of a card or every page of a letter, where the number and the QR code can appear again.
  • QR codes carry data. The QR code on Aadhaar documents holds demographic details, and on newer documents a photo, signed by UIDAI so it can be verified offline. Masking the printed digits does nothing to that data. If your workflow does not verify the QR code, cover it in stored copies; if it does, verify it at intake with UIDAI’s offline verification methods and store the result, not the readable code.

Test masking with fictional specimens

Never test on copies of real customers’ Aadhaar documents. Build a test set from clearly fictional specimens instead:

  1. Mark every specimen. Put “SPECIMEN” or “TEST” across each test document and keep the set inside test environments, so it cannot be mistaken for a real identity document.
  2. Record the expected result. For each specimen, record where every number, VID and QR code sits and what the masked output should show, so tests can score misses automatically.
  3. Include the hard cases. Fictional numbers that pass and fail the check digit, unrelated 12-digit numbers that should stay unmasked, labels in English, Hindi and regional languages, and degraded scans and phone-photo conditions.
  4. Score both directions. Count missed numbers, which expose people, and over-masked values, which break the workflows that need them.

For planning test documents with known values, see the synthetic test data generation guide.

Not legal advice. This guide summarises how teams commonly handle Aadhaar copies and describes the Aadhaar rules in general terms; GritWorks is a software company, not a law firm. Whether you may collect, store or share an Aadhaar number, and in what form, depends on your sector, your purpose and the current Act, regulations and UIDAI circulars. Masking is one safeguard, not compliance on its own, and redaction is not authorization: if a person or system should not have a record, block access instead of sending a masked copy.

What GritWorks does not replace

  • GritWorks complements authorization, governance and e-discovery tools rather than replacing them. Access control, data catalogues, retention policy and legal review platforms keep their jobs; GritWorks prepares the documents, images and audio that move between them.
  • Redaction is not authorization. If a person or system is not entitled to a record, block access instead of sending a redacted copy.
  • Automated redaction alone is not a declaration of HIPAA de-identification. HIPAA recognizes the Safe Harbor and Expert Determination methods; policies, validation and human review must match the intended use and recipient.
  • PII flagging is not redaction. GritTransform can flag potentially sensitive values in extracted results, but that does not remove them from the source. Use GritRedact when content must be removed.
  • Engagement is sales-assisted. GritWorks has no public or self-serve API, SDK, MCP server or free tier, and publishes no price list: pricing is agreed with sales. Customer APIs are provided after onboarding.

Common questions

What is Aadhaar masking?

Aadhaar masking hides the first eight digits of the 12-digit Aadhaar number and leaves the last four visible, written as XXXX XXXX 1234. It lets a team match a document to a record without keeping the full number.

What is a masked Aadhaar?

A masked Aadhaar is a copy of an Aadhaar document on which only the last four digits of the number can be read. UIDAI offers a masked e-Aadhaar for download, and organisations can mask the copies they collect.

Can a company store a full Aadhaar number?

Only where the law allows it. UIDAI requires entities permitted to store Aadhaar numbers to keep them in an encrypted Aadhaar Data Vault; other organisations are generally expected to keep a masked copy or none. Check the current rules for your case; this is not legal advice.

Is covering the number in the image enough?

No. Searchable PDFs, OCR output, search indexes, file names and metadata can still hold all 12 digits. Mask the text as well as the pixels, and re-run OCR on the output to confirm no full number remains.

How does the Verhoeff check digit help?

The last digit of an Aadhaar number is a Verhoeff check digit. Checking it lets a detector reject most 12-digit numbers that are not Aadhaar numbers, but about one in ten random numbers passes by chance, so combine it with format and context.

Should the Aadhaar QR code be masked?

The QR code carries demographic data, and on newer documents a photo, that masking the printed digits does not hide. If your workflow does not verify it, cover it in stored copies; if it does, verify at intake and store the result.

Start with your workflow

Put your unstructured data to work.

Tell us what your team needs to achieve. We’ll help you choose the right products, work through your requirements and explore on-premises or SaaS deployment.

Request a working session