Aadhaar generator and validator

Generate and validate a Aadhaar for tests, with the check digit algorithm shown with a worked example.

loading Aadhaar generator and validator
About this tool

Aadhaar: what it is and how to test it

Aadhaar is the 12-digit identity number of residents of India, issued by the UIDAI. Banks, telecoms and government services ask for it, and forms validate it locally before sending it. Its check digit uses the Verhoeff algorithm, which catches every single-digit error and every swap of two adjacent digits.

For tests only. These numbers have a correct format and check digit but belong to no real person or account. Never use them to deceive, to open accounts or to bypass a check. The numbers on this page come from the same generator as the tool, with a fixed seed so that the examples do not change; the tool creates new ones at every click.

Structure of the number

12 digits written in groups of four (2345 6789 0123): the first digit is never 0 or 1, 10 digits of sequence follow and the last digit is the check digit.

The check digit, step by step

Verhoeff works with three fixed tables: a multiplication table d (the dihedral group of order 10), a permutation table p and an inverse table. The digits are processed from right to left; at each step the digit is permuted by p (the row depends on the position, modulo 8), combined with the running value c by the table d, and the check digit is the inverse of the final c. To validate a whole number the same loop runs over all 12 digits, and the number is valid if c ends at 0.

Worked example with 4222 5823 7418:

Step (right to left)CharacterPermuted digitRunning value c
1155
2473
3758
4335
5282
6813
7514
8221
9278
10208
11408

The final c is 8; the inverse table gives the check digit 8. To validate the full number the same loop runs over all 12 digits and must end in 0.

Valid examples

Five numbers generated by the tool with a fixed seed, each one accepted by its validator:

Example (formatted)Without maskValidator
4222 5823 7418422258237418valid
2595 8717 3708259587173708valid
2897 5340 0622289753400622valid
7520 1342 2784752013422784valid
8787 5377 9284878753779284valid

How the validator answers

The same first example, one with a changed ending and one truncated, checked by the validator:

ValueResultReason
4222 5823 7418valid-
422258237419invalidthe Verhoeff check failed
4222582374invalidneeds 12 digits

Common mistakes

  • Applying a mod 10 or Luhn check to an Aadhaar will reject about 1 in 10 valid numbers: the algorithm is different and the two give different results.
  • Do not store, log or send real Aadhaar numbers to a service you do not control: the rules limit how the number may be collected. Use generated numbers for tests.

Frequently asked questions

What is the Verhoeff algorithm?

A check digit scheme published by Jacobus Verhoeff in 1969 based on the dihedral group D5. Unlike Luhn, it detects all transpositions of adjacent digits, which is why India chose it for Aadhaar.

Can the first digit of an Aadhaar be 0 or 1?

No. Numbers starting with 0 or 1 are not issued, so the validator rejects them even if the check digit is right.

Can I use a Aadhaar number generated here in a real system?

No. A number such as 4222 5823 7418 has a correct format and check, but nobody was issued it, and it may coincide with a real holder by chance. Use it in test environments, demos and automated tests that never leave your control.

Report a problem