The Verhoeff algorithm is a check-digit method designed by Jacobus Verhoeff in 1969. Unlike simpler schemes, it is built on the dihedral group D5, which lets it catch every single-digit error and every adjacent transposition — including the 0-and-9 swap that the Luhn algorithm misses. This checker validates numbers and computes the correct check digit in your browser.
How it works
Verhoeff relies on three lookup tables: a multiplication table d, a permutation table p, and an inverse table inv.
- To validate, start with
c = 0. For each digit, processed from the right at positioni, setc = d[c][p[i mod 8][digit]]. The number is valid ifcends at0. - To generate a check digit for a payload, run the same loop with the position index offset by one, then the check digit is
inv[c].
The permutation table is what makes the algorithm position-sensitive, and the non-commutative group multiplication is what catches transpositions.
Example
The payload 236 has Verhoeff check digit 3, so 2363 is valid. Changing the last digit to 2364 makes the checksum fail, which the tool reports along with the correct expected digit.
Notes
The tool implements the standard published d, p and inv tables, so its results match reference implementations and real-world Aadhaar check digits. A valid checksum confirms internal consistency only, not registration. All computation runs locally and nothing leaves your browser.