Verhoeff algorithm
The Verhoeff algorithm is a checksum for error detection first published by Dutch mathematician Jacobus Verhoeff in 1969. It was the first decimal check digit algorithm that detects all single-digit errors, and all transposition errors involving two adjacent digits, which was at the time thought impossible with such a code. The method was independently discovered by H. Peter Gumm in 1985, this time including a formal proof and an extension to any base.
The Verhoeff algorithm is a checksum for error detection first published by Dutch mathematician Jacobus Verhoeff in 1969. It was the first decimal check digit algorithm that detects all single-digit errors, and all transposition errors involving two adjacent digits, which was at the time thought impossible with such a code. The method was independently discovered by H. Peter Gumm in 1985, this time including a formal proof and an extension to any base. m = \begin{pmatrix} 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\\ e & r & r^2 & r^3 & r^4 & s & rs & r^2s & r^3s & r^4s\end{pmatrix} Let the nth digit be a n and let the number of digits be k. For example given the code 942 then k is 3 and . Now define the permutation f = \begin{pmatrix} e & r & r^2 & r^3 & r^4 & s & rs & r^2s & r^3s & r^4s\\ r & s & r^2s & rs & r^2 & r^3s & r^3 & e & r^4s & r^4\end{pmatrix} For example, f(r^3) = rs . Another example is f^2(r^3) = r^3 since f(f(r^3)) = f(rs) = r^3 . Using multiplicative notation for the group operation of D 5 , the check digit is then simply a value c such that f^0(c) \cdot f^1(a_k) \cdot \ldots \cdot f^{k-1}(a_2) \cdot f^k(a_1) = e c is explicitly given by multiplicative inverse: c = \left(\prod_{n=1}^k f^n(a_{k+1-n})\right)^{-1} For example the check digit for 942 is 7. To verify this, use the mapping to D 5 and insert into the LHS of the previous equation f^0(r^{2}s) \cdot f^1(r^2) \cdot f^2(r^4) \cdot f^3(r^{4}s) = e To evaluate this permutation quickly use that f^3(r^4s) = f^2(r^4) = f^1(r^2) = f^0(r^2 s) = r^2 s to get that r^2 s \cdot r^2 s \cdot r^2 s \cdot r^2 s = e This is the same reflection being iteratively multiplied. Use that reflections are their own inverse. (r^2 s \cdot r^2 s) \cdot (r^2 s \cdot r^2 s) = e^2 = e In practice, the algorithm is implemented using simple lookup tables without needing to understand how to generate those tables from the underlying group and permutation theory. This is more properly considered a family of algorithms, as other permutations work too. Verhoeff's notes that the particular permutation, given above, is special as it has the property of detecting 95.3% of the phonetic errors. The strengths of the algorithm are that it detects all transliteration and transposition errors, and additionally most twin, twin jump, jump transposition and phonetic errors. The main weakness of the Verhoeff algorithm is its complexity. The calculations required cannot easily be expressed as a formula in say . Lookup tables are required for easy calculation. A similar code is the Damm algorithm, which has similar qualities.
References
No reference rows published for this article.
Cite this article
MLA
"Verhoeff algorithm." encyclopegia.org, 2026, https://encyclopegia.org/wiki/verhoeff-algorithm. Accessed 24 November 2026.
Chicago
"Verhoeff algorithm." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/verhoeff-algorithm.
APA
encyclopegia.org. (2026). Verhoeff algorithm. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/verhoeff-algorithm
Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON
Claims
| Predicate | Value | Source |
|---|---|---|
| publication date | 1969 | Wikipedia |