Aadhar number

What is Aadhar number ?
It is a 12-digit unique identification number issued by the Indian government to every individual resident of India.



How to validate Aadhar number ?
  • To validate aadhar number we use Verhoeff algorithm. It is a  checksum formula for error detection developed by the Dutch mathematician Jacobus Verhoeff and was first published in 1969. 
  • It was the first decimal check digit algorithm which detects all single-digit errors, and transposition errors.


  • The Verhoeff algorithm can be implemented using these three tables a multiplication table d, an inverse table inv, and a permutation table p.
  • The first table, d, is based on multiplication in the dihedral group D5 and is simply the Cayley table of the group. Note that this group is not commutative, that is, for some values of j and k, d(j,k) ≠ d(k, j).
  • The inverse table inv represents the multiplicative inverse of a digit, that is, the value that satisfies d(j, inv(j)) = 0.
  • The permutation table p applies a permutation to each digit based on its position in the number. This is actually a single permutation (1 5 8 9 4 2 7 0)(3 6) applied iteratively i.e. p(i+j,n) = p(i, p(j,n)).

Generate a check digit of 52118513337 :



  • Create a table of i mod 8 (01234567) and n(i)[Aadhar number] from bottom to top and initialize check digit value to zero.
  • With the help of i and n(i) tables write p values which is p(i,n) (look in the table).
  • Initialize the checksum c to zero. For each index i of the array n, starting at zero, replace c with d(c, p(i mod 8, ni)) or d(c,p).
  • Here the last value we got 6 and look in inv table inv(6) = 6.
  • The generated check digit is 6.

Validate the Aadhar number 521185133376 : 



  • To validate Aadhar number create a table take i mod 8 and n(i) values and look for in p and d table.
  • In the c column if the bottom most value is zero then the aadhar number is valid.
  • The Verhoeff algorithm detects all type of errors but It is very complex to understand.