Results are provided for informational purposes only and may contain errors. Please verify important information independently. Use of this tool is at your own risk.
What the Credit Card Validator does
The Credit Card Validator checks whether a card number is well-formed. It strips spaces and dashes, confirms the length is between 12 and 19 digits, runs the Luhn checksum and names the card network from the leading digits: Visa, Mastercard, American Express, Discover, Diners Club or JCB.
The Luhn algorithm catches most typing mistakes: starting from the right, every second digit is doubled (subtracting 9 when the result is above 9) and the total must be divisible by 10. A single wrong digit or two swapped neighbouring digits almost always breaks it. Passing the check does not mean a card exists, is active or has funds; only the card issuer can tell you that. The check runs entirely in your browser and the number is never sent anywhere.
When to use it
- Testing a checkout form with the published test numbers of a payment provider.
- Writing client-side validation and checking your own Luhn implementation against a known result.
- Cleaning a data import where card-like numbers need to be flagged before they are stored.
- Explaining to a user why a mistyped number is rejected before it reaches the payment gateway.
Worked example
4111 1111 1111 1111
Passes Luhn check Network: Visa
4111 1111 1111 1112
Fails Luhn check Network: Visa
Common questions about the Credit Card Validator
Is it safe to paste a real card number here?
The validation is plain JavaScript on the page and makes no network request, so the number does not leave your device. Even so, there is no reason to use a real card: every payment provider publishes test numbers that pass the Luhn check.
Why does a valid-looking number fail?
Usually one digit is wrong or two are swapped. The last digit of every card number is a check digit calculated from the others, so any single change makes the total no longer divisible by 10.
How is the network detected?
From the issuer prefix: 4 is Visa, 51-55 and 22-27 are Mastercard, 34 and 37 are American Express, 6011 and 65 are Discover, 300-305, 36 and 38 are Diners Club and 35 is JCB. Unknown prefixes show as Unrecognized.
Can I use the Luhn check for other numbers?
Yes. The same checksum protects IMEI numbers, many loyalty-card numbers and some national identifiers. The length rule here is specific to payment cards, so numbers outside 12-19 digits are rejected before the checksum runs.
Is this tool free?
Yes, it's free to use. No signup, no email required. Get results on this page.
How do I get my result?
Use the tool on this page. Your result appears here; no email delivery is required.