Credit Card Number Validator
Check a card number with the Luhn algorithm, detect the network (Visa, Mastercard, Amex, Discover, JCB, UnionPay…) and validate its length. Nothing is sent.
Spaces and hyphens are ignored.
| Result | Valid number (passes Luhn and length rules) |
|---|---|
| Card network | Visa |
| Luhn checksum | Passed |
| Length | 16 digits (allowed: 13, 16, 19) |
| Length allowed for this network | Yes |
| Formatted | 4111 1111 1111 1111 |
| Security code length | 3 |
What is Credit Card Validator?
This validator checks whether a payment card number is well-formed: it runs the Luhn checksum, identifies the card network from the issuer range (IIN/BIN), verifies the length is allowed for that network and formats the number in the network's usual grouping. Everything runs in your browser.
How to use Credit Card Validator
- Type or paste a card number; spaces and hyphens are ignored.
- Read the result: overall verdict, card network, Luhn checksum, length and whether it is allowed.
- Use the formatted number and the security code length as needed for test data.
Example
378282246310005
American Express · Luhn passed · 15 digits (allowed: 15) · formatted 3782 822463 10005 · security code length 4
When to use Credit Card Validator
Use it to test checkout forms, generate correct-looking test data or catch typos before submitting a number. A valid result does not mean the card exists, is active or has funds – only the issuer can confirm that through a payment authorization. Never paste real card numbers into tools you do not trust.
How Credit Card Validator works
The Luhn algorithm doubles every second digit from the right, subtracts 9 from results above 9 and checks that the total is divisible by 10. The network is detected from known IIN ranges, checked from most to least specific: Amex 34/37, Diners 300–305/36/38/39, JCB 3528–3589, Mir 2200–2204, Mastercard 51–55 and 2221–2720, Discover 6011/644–649/65, UnionPay 62/81, Visa 4, Maestro 50/56–69. Grouping follows each network (Amex 4-6-5, others 4-4-4-4).
Common Use Cases
- Verify that official test numbers such as 4111 1111 1111 1111 pass your form's validation.
- Show the right card logo in a checkout form as the user types.
- Catch a mistyped digit before a payment API call.
- Teach or demonstrate how the Luhn checksum works.
Security Note
Use test card numbers for development. The tool does not store or transmit what you type, but avoid entering real cards on any website other than the merchant's checkout.
FAQs
Does a passing Luhn check mean the card is real?
No. About one in ten random numbers passes Luhn. It only detects typing errors.
Is the number sent to a server?
No. All checks are pure JavaScript in your browser; there is no network request.
Why is a 16-digit number starting with 62 shown as UnionPay?
62 is UnionPay's main range. Some co-branded cards also run on other networks, which only the issuer data can tell.