Verify whether a numeric string satisfies the Luhn mod-10 check digit algorithm — the same checksum used on credit-card numbers, IMEI device identifiers, and several national ID schemes.
Algorithm
Starting from the rightmost digit:
- Double every second digit; if doubling exceeds 9, subtract 9.
- Sum all digits (modified and unmodified).
- The number is valid if the total is a multiple of 10.
Non-digit characters are stripped before processing. An empty or all-non-digit input fails validation.
When to use it
Catch single-digit typos before payment submission, validate test card numbers in PCI-scoped sandboxes, or teach how checksums detect transcription errors without full cryptographic hashing.
Limitations
Passing Luhn only means the string is arithmetically consistent — not that the account exists, is active, or belongs to a given issuer. Some valid business identifiers intentionally omit Luhn. The tool validates one number at a time and does not identify card brand or country.