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

Enter a number above to validate

How the Luhn Algorithm Works

  1. Starting from the rightmost digit (the check digit), move left.
  2. 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).
  3. Sum all the digits (both doubled and untouched).
  4. If the total mod 10 = 0, the number is valid.

Where Luhn Is Used

IdentifierTypical LengthCheck Digit
Credit / Debit Card (PAN)13–19 digitsLast digit
IMEI (mobile device ID)15 digitsLast digit
ICCID (SIM card serial)19–20 digitsLast digit
NPI (US healthcare provider)10 digitsLast digit
Canadian SIN9 digitsLast digit
Privacy note: All validation runs in your browser using JavaScript. No card numbers are ever sent to a server. Test numbers provided are industry-standard test PANs — not real cards.

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.