Check a Primary Account Number against the Luhn mod-10 checksum, identify the issuing network from the IIN, and compute the correct check digit for a partial number.
What is the Luhn algorithm? The Luhn algorithm, or mod-10 checksum, validates identification numbers such as payment card PANs. Every second digit is doubled from the right, summed with the rest, and a valid number produces a total divisible by 10.
The Luhn algorithm is a simple checksum used across payment cards, IMEI numbers, and other identifiers. Reading right to left, every second digit is doubled; any doubled value over nine has nine subtracted. All resulting digits are added together, and a number is valid when that total is a multiple of ten. It catches every single-digit error and most adjacent transpositions.
The leading digits of a PAN — the Issuer Identification Number, historically called the BIN — map to a card network. This tool recognises the major ranges by prefix and length. It does not perform a live BIN lookup against an issuer database, so it identifies the network, not the specific bank.
No. Validation, detection, and generation all run in your browser. Nothing is transmitted or stored.
No. Luhn only proves the number is well-formed. It says nothing about whether the account exists or can be charged.
We engineer and certify payment apps end to end. See custom development →