Check whether a credit card number is mathematically valid using the Luhn algorithm and detect the card brand instantly.
This tool checks whether a card number is structurally valid: that it has a recognised prefix, the right length for its network, and a correct check digit according to the Luhn algorithm. It is useful for catching typos before a payment form rejects the number.
It does not check whether a card is active, has funds, or belongs to you. A number can pass the Luhn check and still be declined.
The Luhn algorithm (also called the mod 10 algorithm) is a simple checksum used by almost every payment card:
Example: for the number 79927398713, doubling every second digit from the right and adding everything gives 70, which is divisible by 10, so the number is valid. Changing any single digit breaks the total, which is why the check catches most typing mistakes.
| Network | Starts with | Length |
|---|---|---|
| Visa | 4 | 13, 16 or 19 digits |
| Mastercard | 51–55, 2221–2720 | 16 digits |
| American Express | 34, 37 | 15 digits |
| Discover | 6011, 644–649, 65 | 16–19 digits |
| JCB | 3528–3589 | 16–19 digits |
| UnionPay | 62 | 16–19 digits |
To see which bank and country a card belongs to, use the BIN checker. Merchants weighing up disputes can use the chargeback vs refund calculator.