Luhn algorithm (mod-10) checker
The Luhn algorithm is a simple checksum invented by Hans Peter Luhn and used to catch accidental typos in identification numbers — credit and debit cards, IMEI device serials, SIM ICCIDs, and many national IDs all carry a Luhn check digit. This tool tells you instantly whether a number passes, and also computes the check digit, which is handy for generating consistent test data.
How it works
Walking the digits right to left:
- Every second digit is doubled. If doubling gives a result over 9, subtract 9 (equivalent to adding the two digits).
- All the digits are summed.
- The number is valid when the total is a multiple of 10.
To find the check digit for a payload (a number without its final digit), the tool computes the Luhn sum as if a 0 were appended, then the answer is (10 − sum mod 10) mod 10.
Example
Check 4539 1488 0343 6467 (a Luhn-valid test card):
- Doubling every second digit from the right and reducing values over 9 produces a running total.
- That total is a multiple of 10 → passes the Luhn check.
Now take a payload 7992739871 with no check digit. The Luhn sum of 79927398710 leaves a remainder, and the tool reports the required check digit as 3, so 79927398713 would pass.
What Luhn protects (and doesn’t)
| Detects | Misses |
|---|---|
| Any single wrong digit | The 09 ↔ 90 transposition |
| Most adjacent transpositions | Whether the account is real |
| Most twin-digit errors | Whether the card is active |
Privacy: the entire calculation runs in your browser. Nothing you type is uploaded, logged, or stored. A pass means the number is internally consistent — never that it belongs to a real, active account.