Luhn Algorithm Validator
Validate and generate Luhn check digits (mod 10 algorithm) for credit cards, IMEI, ICCID, and other identifier numbers. Everything runs in your browser — numbers are never transmitted.
Card / Identifier Number
Result
How the Luhn Algorithm Works
- Starting from the rightmost digit (the check digit), move left.
- Double the value of every second digit. If doubling results in a number greater than 9, sum the digits (e.g., 7×2=14 → 1+4=5).
- Sum all the digits (both doubled and untouched).
- If the total mod 10 = 0, the number is valid.
Where Luhn Is Used
| Identifier | Typical Length | Check Digit |
|---|---|---|
| Credit / Debit Card (PAN) | 13–19 digits | Last digit |
| IMEI (mobile device ID) | 15 digits | Last digit |
| ICCID (SIM card serial) | 19–20 digits | Last digit |
| NPI (US healthcare provider) | 10 digits | Last digit |
| Canadian SIN | 9 digits | Last digit |
Related Tools
CRC Calculator | Crypto Checksum Verifier | EMV TLV Parser
Real-World Luhn Applications
The Luhn algorithm is used in many identification number systems worldwide. Understanding where and how it is applied helps in developing payment systems, SIM card management tools, and device identity verification.
Credit Card Structure
Credit card numbers (PAN) follow ISO/IEC 7816 and are typically 16 digits. The structure: 6-digit BIN/IIN (Bank Identification Number) identifying the issuer, variable-length account number, and a single Luhn check digit at the end. The BIN range determines the card brand: 4=Visa, 51-55 and 2221-2720=Mastercard, 34/37=Amex, 6011/65=Discover, 62=UnionPay. This tool automatically detects the brand from the BIN and validates the Luhn check digit.
IMEI and ICCID
IMEI (International Mobile Equipment Identity) is a 15-digit number identifying a mobile device. The first 8 digits are the TAC (Type Allocation Code) identifying the model, followed by a 6-digit serial number and a Luhn check digit. The first 2 digits of TAC typically indicate the manufacturer. ICCID (Integrated Circuit Card Identifier) is a 19-20 digit number identifying a SIM card, starting with 89 (telecommunications industry identifier), followed by country code and issuer ID. Both use Luhn for the check digit. For TLV-encoded card data, use our BER-TLV Parser.