Guide
The Verhoeff algorithm: a stronger check digit than Luhn
Check digits protect long numbers from typing mistakes. The Luhn formula behind credit cards is simple, and it has a blind spot: it misses some swaps of two neighbouring digits, such as 09 and 90. In 1969 the Dutch mathematician Jacobus Verhoeff published a scheme that closes it. His algorithm detects every single-digit error and every transposition of adjacent digits, which together make up the great majority of human typing mistakes. It is used in India’s Aadhaar identifier, among others. This page validates Verhoeff numbers and computes check digits.
How it works
The method treats the digits 0 to 9 as elements of a small group of symmetries, the dihedral group of order 10. It moves from the right-hand end of the number to the left. At each position the digit is passed through a permutation that depends on the position (mod 8), and the result is combined with a running value using the group’s multiplication table. For a valid number, the final running value is 0. For creating a check digit, an inverse table gives the digit that brings the running value to zero. Because position changes the permutation, swapping two neighbours always changes the result.
A worked example
Press Sample. The list holds four numbers, three valid and one not. 2363 is valid with check digit 3, and its first three digits are 236. 123451 is valid with check digit 1. 2364 has the last digit changed and fails, and the page shows that the correct check digit is 3. 234567890124 is a valid 12-digit Verhoeff number with check digit 4. In the calculator below, entering 236 gives the check digit 3 and the complete number 2363. Swap the 3 and 6 in 2363 to get 2336 and the check fails, which is exactly what Luhn cannot always promise.
Aadhaar mode
Select “Aadhaar number format” to apply the extra rules. An Aadhaar number has 12 digits, never starts with 0 or 1, and its last digit is the Verhoeff check digit of the first eleven. Spaces and hyphens in groups of four, the usual display form, are ignored. A pass means the number is well formed, nothing more. Never type real Aadhaar numbers into websites you do not trust. This page works entirely in the browser and sends nothing, but test data is safer.
Using the calculator
Developers who design their own identifiers, such as membership numbers or ticket codes, can pick Verhoeff to protect them. Enter the base digits to obtain the digit to append, and use the validator to test the numbers you generate. For long numbers keep the base digits as text and not as an integer, to avoid dropping leading zeros.
Why it is not everywhere
Luhn needs only addition and a small adjustment, which suited early payment terminals. Verhoeff needs three small tables, which is trivial today but was an extra cost then, and the card networks’ formats are fixed by standards. Another scheme, the Damm algorithm, achieves the same detection power with a single table.
Limits
The page checks the digits and format. It does not verify that a number was issued or who holds it. Check digits cannot detect deliberate fraud; they catch honest mistakes.
Related tools
- Luhn Validator covers the more common mod-10 check.
- PAN and TAN Format Validator handles another Indian identifier.
- GSTIN Validator uses a base-36 check character.
- ISBN Converter and Validator shows a weighted-sum check in action.
Checked against the current version of the Verhoeff Validator on .

