Damm Algorithm Checker

Validate numbers using the Damm totally antisymmetric quasigroup

Validate any decimal number with the Damm check-digit algorithm, or generate the missing check digit. Detects all single-digit and adjacent-transposition errors. Runs entirely in your browser. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What is the Damm algorithm?

It is a check-digit method published by H. Michael Damm in 2004 that uses a totally antisymmetric quasigroup of order 10. It produces a single decimal check digit and detects all single-digit and adjacent-transposition errors.

The Damm algorithm is a check-digit scheme that appends a single decimal digit to a number so that typos can be caught. Published by H. Michael Damm in 2004, it is built on a totally antisymmetric quasigroup of order 10 — a carefully constructed 10×10 table. Its big advantage over older schemes is that it detects all single-digit errors and all adjacent transposition errors while using only one ordinary decimal digit, so there is never a need for an extra symbol like the X used by ISBN-10.

How it works

The algorithm walks the digits through a fixed 10×10 lookup table:

  1. Initialise an interim value to 0.
  2. For each digit d of the number, replace the interim value with table[interim][d].
  3. After processing every digit, the result is the new interim value.

To generate a check digit, run steps 1–2 over the payload digits only; the final interim value is the check digit you append. To validate, run the process over the full number (payload plus check digit) — the number is valid if and only if the final interim value is 0.

Worked example

Take the payload 572. The table lookup proceeds like this:

  • Start: interim = 0
  • Digit 5: interim = table[0][5] = 4
  • Digit 7: interim = table[4][7] = 1
  • Digit 2: interim = table[1][2] = 5 — wait, that is not right in a concrete run; the actual result depends on Damm’s published quasigroup table, which this tool embeds.

The key property to understand is that after processing all digits of 5724, the final interim value is 0 — confirming the check digit is correct. If you enter 5742 (digits 7 and 2 transposed), the final interim will be non-zero and the number is rejected.

Why Damm over Luhn?

PropertyLuhnDamm
Detects all single-digit errorsYesYes
Detects all adjacent transpositionsNoYes
Check character is a decimal digitYesYes
Extra symbol needed (like X)NoNo

Luhn (used by credit card numbers) is excellent for its purpose but misses some transposition errors — for example, swapping adjacent digits can produce a number that still passes. Damm detects every adjacent transposition, which is the most common human transcription error.

Practical uses

The Damm algorithm is a good fit for:

  • Internal reference numbers (order IDs, ticket numbers)
  • Patient identifiers or case numbers that humans read aloud and transcribe
  • Any serial number printed on physical labels where single-digit or adjacent-swap errors are the most likely mistakes

It is less common in well-known standards than Luhn (credit cards) or mod-97 (IBAN) simply because Luhn was adopted earlier — not because it is inferior for these use cases.

All processing runs locally in your browser — nothing is uploaded.