Credit Card Validator

Validate card numbers and detect the card type.

Ad

Nothing is stored or transmitted. All validation happens locally.

Ad

Frequently Asked Questions

How does the Luhn algorithm work? +
The Luhn algorithm doubles every second digit from the right. If the doubled value exceeds 9, subtract 9. Then sum all digits. If the total is divisible by 10, the number passes the check. It catches single-digit errors and most transposition errors.
How is the card type detected from the number? +
Card networks use specific prefix ranges. Visa starts with 4, Mastercard with 51-55 or 2221-2720, Amex with 34 or 37, and Discover with 6011, 644-649, or 65. The number length also varies: Visa is 13 or 16 digits, Amex is 15, and most others are 16.
Can a number pass the Luhn check but still be invalid? +
Yes. The Luhn algorithm only verifies the mathematical checksum, not whether the card actually exists or has funds. Banks perform additional validation against their records. A passing Luhn check simply means the number is formatted correctly.
What is a check digit? +
The check digit is the last digit of a credit card number. It is calculated from all the other digits using the Luhn formula so that the full number satisfies the checksum. It exists specifically to catch accidental entry errors.
Ad