Check a card number with the Luhn algorithm and detect the brand.
Checked locally — your number is never stored or sent.
How do you validate a credit card number?
The Luhn algorithm doubles every second digit from the right (subtracting 9 if over 9), sums all digits, and the number is valid when the total is divisible by 10. The Luhn check catches most typos but does not confirm the card is real or active. For example, 4242 4242 4242 4242 is a Visa test number that passes.
Understanding your result
The Luhn check catches most typos. It does not confirm the card is real, active or funded.
Formula and method
The Luhn algorithm doubles every second digit from the right (subtracting 9 if over 9), sums all digits, and the number is valid when the total is divisible by 10.
Worked example
4242 4242 4242 4242 is a well-known Visa test number that passes the Luhn check.
How to use this tool
- Enter the card number (spaces and dashes are ignored).
- See whether it passes the Luhn check and its brand.
Common mistakes to avoid
- Treating a Luhn pass as proof the card works — it only confirms the format.
About the Credit Card Validator
Check whether a card number is well-formed using the Luhn algorithm, and see which brand it belongs to. Everything runs locally — nothing is stored or sent.
Who should use this tool
Developers testing payment forms with test card numbers, and anyone checking for a typo.
Explore all Developer Tools tools
Frequently asked questions
Is my card number stored?
No. The check runs in your browser and the number is never saved or transmitted.
Does a valid result mean the card works?
No. It only means the number is correctly formed; it says nothing about whether the card is active.