What is the Damm algorithm?

The Damm algorithm adds a check digit to the end of a number so that typing mistakes get caught. H. Michael Damm published it in 2004. It catches every single wrong digit and every swap of two neighboring digits, which the simpler Luhn algorithm misses in one case, 09 and 90. Instead of arithmetic, it uses one lookup table, a grid of 10 by 10 digits.

Tool description

Type or paste a number with its check digit in the Number field, and the Result shows whether it passes the Damm check as you type. Anything that isn't a digit, such as spaces, dashes or letters, is left out before the check, so a number written in groups works as it is.

For example, 123 gets the check digit 4. So 1234 passes, while 1324, with two digits swapped, and 1235, with one wrong digit, both fail.

For random numbers that pass the check, use the Damm number generator.

Features

  • Checks numbers of any length as you type
  • Catches every single wrong digit and every swap of two neighboring digits
  • Ignores spaces, dashes and other characters between the digits

How the check works

Start at 0 and go through the digits from left to right. The current value picks a row of the lookup table, the next digit picks a column, and the cell there becomes the new value. A number with the right check digit always ends at 0.

Good to know

  • Zeros at the start don't change the result, so 01234 passes like 1234.
  • A passing number only has a consistent check digit. It doesn't mean the number was ever issued to anyone.
  • The check runs in your browser, so the number isn't sent anywhere.