Damm Check Digit Generator
The two mistakes people actually make when copying a number are getting one digit wrong and swapping two next to each other. A check digit is worth having only if it catches both, and the familiar ones do not quite: the Luhn digit misses a few particular swaps. Damm's method, published in 2004, catches every single-digit error and every neighbour swap, using one extra digit and a single table lookup per digit.
What this generator does
Runs the number through Damm's table one digit at a time and appends the digit that brings the running value back to zero, then tries every mistyping and every neighbour swap against the finished number.
How to use this tool
- Type the number you want to protect, or leave it blank to have one made up.
- Read the check digit added at the end.
- Look at the counts: every mistyping and every swap was tried against it.
- Validate a number later by running the whole thing through — a good one ends at zero.
Understanding the controls
- Number to protect
- Digits only. Leave it blank and one is made up, which is useful for producing test data that validates.
- Length if made up
- How many digits the made-up number should have, from 2 to 24, before the check digit is added.
Common use cases
- Adding a check digit to a reference, ticket or account number
- Choosing between check digit methods on evidence rather than habit
- Reducing support load from mistyped references
- Teaching how error detection works with a demonstration rather than a claim
- Generating sample numbers that validate, for testing
How this generator works
The method uses a ten-by-ten table with two properties: zeros only on the diagonal, and a particular anti-symmetry. Those two together are what guarantee the detection, and the guarantee is demonstrated rather than asserted — every way of getting one digit wrong, and every swap of two adjacent digits, is tried against the finished number and the count of those rejected is shown.
Randomness and fairness
Only the made-up number is random, drawn from the browser's secure generator. The check digit itself is not: a given number always takes the same one.
For how randomness is produced across the whole site, see how Generate Random works.
Limitations and good to know
- Digits only. Letters and separators must be stripped or encoded before use.
- It catches all single-digit errors and all adjacent swaps, but not every double error or every jump transposition.
- A check digit detects mistakes; it does not stop anyone inventing a valid number on purpose.
- One check digit for the whole number, however long — the guarantee does not weaken, but nor does it strengthen.
Privacy and your data
The number you type stays in your browser. Nothing is transmitted or stored.
Related generators
- Perfect Hash GeneratorFinds a hash that sends a fixed list of keys to distinct slots, with no collisions at all.
- De Bruijn Sequence GeneratorOne sequence containing every possible run of a given length exactly once — 10,003 keypresses for all 10,000 four-digit codes.
- Invoice Number GeneratorGenerate a fictional invoice-number example, like INV-2026-004821 — for mockups and test data.
- Purchase Order Number GeneratorGenerate a fictional purchase-order-number example, like PO-58213 — for mockups and test data.