Calculate permutation-based check digits.
Initialising algorithm engine for Verhoeff Calculator...
How Verhoeff Calculator Works?
The Verhoeff Calculator works by passing each digit through a position-dependent permutation table and combining the results with the multiplication table of the dihedral group D5. The final value is inverted to give the check digit.
- 1Reverse the payload so the rightmost digit is processed first.
- 2Set the running check value c to 0.
- 3Look up p = P[(i + 1) mod 8][digit] in the permutation table for each position i (starting at 0).
- 4Update the running value with c = D[c][p] from the D5 multiplication table.
- 5Take the inverse inv[c] after the last digit: that value is the check digit.
- 6Validate a complete number by running the loop over all digits without the +1 shift: a valid number ends with c = 0.
Verhoeff Calculator Formula
The Verhoeff formula is Check Digit = inv( D(…D(D(0, P₁(a₁)), P₂(a₂))…, Pₙ(aₙ)) ), where aᵢ are the payload digits read from the right.
c₀ = 0 cᵢ = D[cᵢ₋₁][ P[i mod 8][aᵢ] ] for i = 1…n (aᵢ read right to left) Check Digit = inv[cₙ]
Dis the 10 × 10 multiplication table of the dihedral group D5.Pis the permutation table: row k applies the base permutation (1 5 7 6 2 8 3 0 9 4) k times.invis the inverse table [0, 4, 3, 2, 1, 5, 6, 7, 8, 9].aᵢis the payload digit at position i from the right.
Position 1: digit 6 → P = 3, D[0][3] = 3 Position 2: digit 3 → P = 3, D[3][3] = 1 Position 3: digit 2 → P = 1, D[1][1] = 2 inv[2] = 3 Complete number = 2363
Verhoeff Calculator Conversion Table
The Verhoeff conversion table shows the inverse lookup for every final value of c and sample payloads converted to complete Verhoeff numbers.
| Final c | Check digit inv[c] | Sample payload | Check digit | Complete number |
|---|---|---|---|---|
| 0 | 0 | 236 | 3 | 2363 |
| 1 | 4 | 12345 | 1 | 123451 |
| 2 | 3 | 142857 | 0 | 1428570 |
| 3 | 2 | 75872 | 2 | 758722 |
| 4 | 1 | 1428570 | 8 | 14285708 |
| 5 | 5 | 84736430954837284567892 | 2 | 847364309548372845678922 |
| 6 | 6 | 0 | 4 | 04 |
| 7 | 7 | 999 | 8 | 9998 |
| 8 | 8 | 2024 | 0 | 20240 |
| 9 | 9 | 50505 | 1 | 505051 |
What is Verhoeff Calculator?
A Verhoeff Calculator is a tool that computes or validates a decimal check digit using the Verhoeff algorithm. Dutch mathematician Jacobus Verhoeff published the algorithm in 1969.
The Verhoeff algorithm detects 100% of single-digit errors and 100% of adjacent transpositions. The method uses no modulus and no weights: three lookup tables do the work.
India's 12-digit Aadhaar number ends with a Verhoeff check digit, which makes Aadhaar the largest deployment of the algorithm with more than 1.3 billion numbers issued.
What are the uses of Verhoeff Calculator?
There are 4 main uses of the Verhoeff Calculator, including Aadhaar checks, identity number design, and error-rate studies.
- Aadhaar validation: Developers confirm the 12th digit of an Aadhaar number before submitting a KYC request.
- Identity number design: Agencies pick Verhoeff for new citizen or member numbers when full transposition detection is required.
- Data entry protection: Call centres protect order and policy numbers read aloud and typed by hand.
- Algorithm teaching: Teachers show group theory in practice through the D5 table.