1. Home
  2. Developer tools
  3. Verhoeff Validator

Verhoeff Validator

The Verhoeff algorithm catches every single-digit error and every swap of adjacent digits. Validate numbers or compute the digit to append.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use Verhoeff Validator

  1. Choose a general number or the Aadhaar format.
  2. Enter numbers one per line.
  3. Or enter digits without the check digit to calculate it.

Features

  • Full dihedral-group multiplication and permutation tables
  • Aadhaar 12-digit rule (cannot start with 0 or 1)
  • Check digit calculator
  • Many numbers at once
  • Shows the correct digit for a failing number
  • Local only

Supported formats

Input

  • One value per line, typed or pasted

You get

  • Verdict
  • Check digit

Private by design

Everything you enter is processed by your browser on this device. Nothing is sent to openWorkstand or anyone else, so the Verhoeff Validator is safe for private and work data. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • For Aadhaar it checks the format and check digit only, not whether the number was issued.
  • Other schemes using Verhoeff may add their own rules.

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.

Checked against the current version of the Verhoeff Validator on .

Frequently asked questions

Why is Verhoeff not used for card numbers?

Card networks standardised on Luhn decades earlier, and it is cheaper to compute with tiny hardware. Verhoeff needs lookup tables, but it is the better detector, and newer schemes such as India's Aadhaar adopted it.

Does a number passing Verhoeff mean it is an Aadhaar number?

No. Any digit string can carry a Verhoeff check digit. For Aadhaar, the page also applies the 12-digit and first-digit rules, and even then it only confirms the shape.

Why is Verhoeff stronger than Luhn?

Luhn misses some swaps of adjacent digits, such as 09 and 90. Verhoeff catches all of them as well as every single-digit mistake.

Can this verify that an Aadhaar number was issued?

No. It checks the format and check digit only. Please do not enter real Aadhaar numbers on sites you do not trust.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.