Credit card number validator
Type or paste a card number to see whether it passes the Luhn checksum and which network its first digits belong to. The check runs entirely in your browser, nothing is sent or stored, and it cannot tell you whether a card exists or has money on it.
Runs in your browser: nothing you enter is sent anywhere.
How to use it
- Type or paste the number. Spaces and hyphens can stay.
- Read the Luhn result and the network.
- If the length row says “Unusual length”, the prefix belongs to a network that does not issue numbers of that length.
How the Luhn check works
Start from the rightmost digit. Leave it as it is, double the next one to the left, leave the next, double the next, and so on. When a doubled digit is above 9, subtract 9. Add everything up: if the total ends in 0, the number passes.
Worked example
Take 4111 1111 1111 1111. Counting from the right, the doubled digits are seven 1s and the leading 4: the 1s give 2 each (14) and the 4 gives 8, so 22. The other eight digits are all 1, adding 8. The total is 30, which ends in 0, so the number passes. The prefix 4 makes it Visa, and 16 digits is a normal Visa length.
Tips and common mistakes
- A failing number is almost always a typo: check for two swapped digits or a missing one.
- The tool checks format only. Expiry date, CVV and the account itself are checked by the bank during payment.
- When building a form, run the Luhn check in the browser for quick feedback, but leave the final decision to your payment provider.
Frequently asked questions
What does the Luhn check prove?
Only that the digits are self-consistent. The Luhn formula catches every single mistyped digit and most swaps of two neighbouring digits, so shops use it to reject typos before contacting the bank. A number that passes may still not belong to any real card.
Can this tell me if a card is real or active?
No. Only the issuing bank knows whether an account exists, is open and has funds. This page has no connection to any bank or payment network and does not send the number anywhere.
How is the network detected?
From the first digits, the issuer identification range: 4 is Visa, 51–55 and 2221–2720 are Mastercard, 34 and 37 are American Express, 6011, 644–649 and 65 are Discover, 62 is UnionPay, 3528–3589 is JCB, 300–305, 36 and 38–39 are Diners Club, 2200–2204 is Mir, and several 5 and 6 ranges are Maestro. Co-branded cards can belong to two networks; the tool shows one.
What is the check digit row for?
It shows which last digit would make the other digits pass. If you are testing your own validation code, change the last digit to that value to get a number that passes; if a typed number fails, the difference hints that a digit was mistyped.
Is it safe to type a real card number here?
The page works offline once loaded and keeps nothing, but there is little reason to paste a real number into any website. For testing, use the published test numbers of your payment provider, such as 4111 1111 1111 1111.