What is the Luhn algorithm?
The Luhn algorithm is the checksum that catches typos in credit-card and IMEI numbers. Learn how it works and validate a number free.
The Luhn algorithm (mod-10 checksum) is a simple formula that detects accidental errors in identification numbers — most famously credit-card numbers, but also IMEIs and some national IDs. It does not prove a number is real, only that it is not a typo.
How the checksum works
Starting from the rightmost digit, double every second digit. If doubling gives a two-digit result, add those digits (or subtract 9). Sum all the digits. If the total is divisible by 10, the number passes the Luhn check. The final digit of a card is the "check digit" chosen to make the whole thing balance.
What it does and does not prove
A number passing Luhn only means the digits are internally consistent — it catches single-digit typos and most transpositions. It says nothing about whether the card exists, has funds, or is active. Real validation requires the issuing network.
Where it is used
Payment forms use it for instant client-side feedback before hitting the payment processor, saving a round trip on obvious typos. IMEI numbers on phones use the same checksum.
Try it now — free, no signup
Use the Luhn validator in your browser. Then, when you need it at scale with an API key and higher limits, grab the full Eveses API.