Luhn / PAN Validator
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.
How the Luhn checksum works
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.
What network detection uses
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.
- Visa — starts with 4
- Mastercard — 51-55 and 2221-2720
- American Express — 34, 37
- Discover — 6011, 64-65, 622126-622925
- Diners Club — 300-305, 36, 38-39
- JCB — 3528-3589 · UnionPay — 62
Frequently asked questions
Is the card number sent anywhere?
No. Validation, detection, and generation all run in your browser. Nothing is transmitted or stored.
Does a valid Luhn mean the card works?
No. Luhn only proves the number is well-formed. It says nothing about whether the account exists or can be charged.
Building card-present or card-not-present flows?
We engineer and certify payment apps end to end. See custom development →
