Credit Card Validator
Local only — nothing is uploaded unless you save or share it.
A credit card validator for the format: the network, the length and the Luhn check digit. Nothing is sent.
- Type or paste the card number. Spaces and hyphens are fine.
- Read the verdict and which network the number belongs to.
- If the checksum failed, compare the last digit with the one the page says the number needs.
This checks the format only. It cannot tell whether a card is real, active or has money on it. The number is checked in your browser and is not sent anywhere.
Save this tool
Keep Credit Card Validator handy
Use your browser's Share menu, then “Add to Home Screen”.
Embed
Put Credit Card Validator on your website
Paste this into your page. It shows the tool, free, with a link back to it.
About this tool
This credit card validator checks whether a card number is correctly formed, and says which part is wrong when it is not. Three things are checked. The leading digits are matched against the published ranges of Visa, Mastercard, American Express, Discover, JCB, Diners Club, UnionPay and Maestro. The length has to be one that network issues, which is 15 digits for American Express and 16 for most Mastercard and Visa cards. And the last digit has to satisfy the Luhn algorithm, a checksum that catches nearly every single mistyped digit and most swapped pairs. When the checksum fails, the page works out the last digit the rest of the number would need and shows it, which is the quickest way to spot a typo in a number you are copying by hand. Be clear about what this cannot do. A valid result means the number is well formed, nothing more. It cannot tell whether the card exists, whether it is active, who it belongs to or whether there is money on it; only the bank that issued it knows that, and only a real payment can ask. So there is no reason to type a real card here. Developers testing a checkout should use the test numbers payment providers publish, and the page recognises the common ones. The number never leaves your browser: the check is arithmetic in the page, and the page makes no request with it.
Frequently asked questions
Does a valid result mean the card is real?
No. It means the number is correctly formed: the right length for its network and a last digit that passes the Luhn checksum. Anyone can make up a number that passes, and a card that was cancelled yesterday still passes. Whether a card exists, is active or has funds is known only to the bank that issued it, and nothing on this page can ask.
What is the Luhn algorithm?
A checksum built into almost every card number. Starting from the right, every second digit is doubled, nine is subtracted from any result over nine, and everything is added up; the total must end in zero. It catches any single mistyped digit and most pairs of neighbouring digits swapped round, which is why a shop's payment form can reject a typo before it asks the bank anything.
How does it know which card network a number belongs to?
From the first digits, which identify the issuer. Visa numbers start with 4, Mastercard with 51 to 55 or 2221 to 2720, American Express with 34 or 37, Discover with 6011, 644 to 649 or 65, JCB with 3528 to 3589, and UnionPay with 62. Each network also issues only certain lengths, so a 16-digit number starting with 37 is wrong however its checksum works out.
Which test credit card numbers can I use?
The ones payment providers publish for developers, such as 4111 1111 1111 1111 or 4242 4242 4242 4242 for Visa, 5555 5555 5555 4444 for Mastercard and 3782 822463 10005 for American Express. They pass every format check and are never real cards, so they are what to type when you test a checkout or a form. This page tells you when a number is one of the well-known test numbers.
Is the card number sent anywhere?
No. The check is arithmetic that runs in your browser, and the page makes no request with the number. Even so, there is no need to type a real card here, because a format check gains nothing from one. The API version checks the number in memory and does not store or log it.
Help improve this tool
Found a bug, want a change, or need a tool we don't have?
You have an unsent draft.
Thanks — that's with us. You'll find the reply in your inbox.Go to my messages