Luhn Algorithm Checker
ValidatorValidate numbers using the Luhn algorithm (Mod 10). Used to verify credit cards, IMEI numbers, and other identifiers. See step-by-step calculation.
Enter Number
Step-by-Step Calculation
Enter a number to see the calculation steps.
How the Luhn Algorithm Works
- Starting from the rightmost digit, double every second digit
- If doubling results in a number > 9, subtract 9 from the result
- Sum all the digits (both doubled and non-doubled)
- If the total is divisible by 10, the number is valid
The Luhn algorithm was created by IBM scientist Hans Peter Luhn in 1954 and is used to validate credit card numbers, IMEI numbers, National Provider Identifier (NPI) numbers, and more.
What is This Tool?
A Luhn algorithm checker validates numbers using the MOD 10 checksum formula. The Luhn algorithm is used to validate credit card numbers, IMEI numbers, Canadian Social Insurance Numbers, and other identification sequences where single-digit errors need to be caught.
Invented by Hans Peter Luhn at IBM in 1954, this simple checksum formula detects any single-digit error and most transpositions of adjacent digits. It works by doubling every second digit from right to left, subtracting 9 from results over 9, summing all digits, and checking divisibility by 10.
Common Use Cases
Payment Processing
Pre-validate credit card numbers on the client side before sending to payment processors, reducing declined transaction rates.
Data Entry Verification
Catch typos in long identification numbers (credit cards, IMEI, SIN) before they enter your database.
Number Generation Testing
Verify that custom number generators produce valid Luhn-checked outputs for credit cards, loyalty cards, or member IDs.
Education & Learning
Understand the Luhn algorithm step-by-step with detailed breakdowns of the doubling, summing, and modulo operations.
Frequently Asked Questions
What numbers use the Luhn algorithm?
Credit/debit cards, IMEI numbers, Canadian SIN, National Provider Identifiers (NPI), and many loyalty card and membership systems.
What errors does Luhn catch?
Luhn detects all single-digit substitution errors and most (but not all) transpositions of adjacent digits. It cannot detect all permutation errors.
How is the check digit calculated?
Double every second digit from right, subtract 9 if the result exceeds 9, sum all digits, and the check digit makes the total divisible by 10.