Check digits · 3,800,668 mutations tested
Swap any two digits that sit one apart, and the Luhn checksum guarding every card payment on earth is mathematically incapable of noticing. Not most of the time. Every time.
Both pass the Luhn check
A check digit is arithmetic hidden in an identifier so that a mistyped one fails to add up. Your card, your books, your car, your patient record and every shipping container in the world carry one. They are not equally good, and the differences are not small.
This page brute-forces the question. For ten real schemes, we generated valid identifiers and injected every classical transcription error at every position — then counted how many passed validation anyway.
Why the hole exists
Luhn doubles every second digit from the right. Two positions that sit one apart therefore fall on the same side of that alternation — both doubled, or neither. Swap them and every term in the sum is unchanged, so the total is unchanged, so the check digit is unchanged.
It is not a bug or an implementation slip. It is a direct consequence of the weighting, and it means the error class is invisible by construction. EAN‑13, which guards every barcode and every ISBN printed since 2007, alternates weights 1 and 3 and has exactly the same hole.
The atlas
Every figure is a measured miss rate: the share of injected errors that still validated. Lower is better; zero means nothing got past.
| Scheme | Single character |
Adjacent swap |
Jump swap |
Twin error |
|---|
Two schemes let nothing through: IBAN and the Australian tax file number. IBAN spends two check digits and a modulus of 97 on the problem, which is why it costs more and catches more. The TFN manages it with nine digits and a table of weights.
Both of them beat the number on your bank card.
Collisions in the wild
Each pair below was produced by the run. Both strings pass their scheme's own validation, so no amount of checking the check digit will tell them apart.
The VIN row deserves its own note. Its transliteration maps several letters onto the
same value — A, J both count as 1; B,
K, S all count as 2 — so substituting one for another
cannot change the checksum. That is why a scheme stamped on every road vehicle misses
7.5% of single-character errors, the worst single-error rate here.
Try it
Paste any identifier — a card number, ISBN, container number, IBAN, VIN. It is checked entirely in your browser and never leaves the page.