Credit Card Validator
Check whether a card number is well-formed (Luhn check) and which network it belongs to — with official test numbers for developers.
Use test numbers. This tool runs entirely in your browser and stores nothing, but there's no reason to type a real card number into any website you don't buy from. It only checks the format — not whether a card exists, is active or has funds.
Official test numbers
| Network | Test number |
|---|
● The number is checked in your browser only. It is never stored, logged or sent anywhere.
What this validator checks
- Luhn check: whether the number passes the checksum every payment card number must pass.
- Network: Visa, Mastercard, American Express, Discover, JCB, Diners Club, UnionPay, Maestro or Mir, from the first digits.
- Length: whether the number of digits is valid for that network.
It only checks the format. It can't tell whether a card exists, is active or has funds — only the bank can, during a payment. Use the test numbers below: there's no reason to type a real card number into a site you aren't buying from.
How the Luhn algorithm works
The last digit of a card number is a check digit. To verify a number:
- Starting from the right, double every second digit (the 2nd, 4th, 6th… from the right).
- If a doubled value is over 9, subtract 9 (16 → 7).
- Add all the digits. If the total ends in 0, the number is valid.
Example with the classic test value 79927398713: the doubled digits give 2, 7, 6, 4, 9 (sum 28), the others 3, 7, 9, 7, 9, 7 (sum 42). 28 + 42 = 70, a multiple of 10: valid. The Luhn check catches any single mistyped digit and most swaps of two neighboring digits.
How to recognize the card network
| Network | Starts with | Length |
|---|---|---|
| Visa | 4 | 13, 16 or 19 |
| Mastercard | 51–55 or 2221–2720 | 16 |
| American Express | 34 or 37 | 15 |
| Discover | 6011, 622, 644–649 or 65 | 16 or 19 |
| JCB | 3528–3589 | 16–19 |
| Diners Club | 300–305, 36, 38, 39 | 14, 16 or 19 |
| UnionPay | 62 | 16–19 |
The first 6 to 8 digits are the BIN (bank identification number), which identifies the issuing bank.
Test card numbers for developers
Payment providers publish numbers that pass the Luhn check but can't be charged, such as 4242 4242 4242 4242 (Visa), 5555 5555 5555 4444 (Mastercard) and 3782 822463 10005 (Amex). Use them in sandbox mode with any future expiry date and any CVC. Click Fill a test number or see the full table on this page.
FAQ
Is it safe to use?
The number is checked in your browser only and never stored, logged or sent. Still, use test numbers: no legitimate need requires typing a real card here.
Why does a valid-looking card get declined?
Passing the Luhn check only means the number is well-formed. A payment can still fail because of the expiry date, the CVC, the balance, fraud checks or a blocked card.
Can it generate card numbers?
No. It validates numbers and lists the official test numbers published for developers.
Does it check IBANs?
No. IBANs use a different checksum (mod 97).