Credit Card Validator
Credit card validator: checks the number’s length for its network (Visa, Mastercard, Amex), then the Luhn check digit. It cannot tell if a card exists. How it works
Use the Credit Card Validator
About the Credit Card Validator
A card number passes this check when its length fits its network and its Luhn check digit matches: 4111 1111 1111 1111 is Visa-length with a matching check digit, while 4242 4242 4242 4243 fails because the check digit is wrong. A pass shows the number is well formed. It does not show that the card exists, is active or has funds.
Card number lengths the tool accepts
| Network | Starts with | Digits allowed |
|---|---|---|
| Visa | 4 | 13, 16 or 19 |
| Mastercard | 51 to 55, 2221 to 2720 | 16 |
| American Express | 34, 37 | 15 |
| Discover | 6011, 644 to 649, 65, 622126 to 622925 | 16 to 19 |
| JCB | 3528 to 3589 | 16 to 19 |
| UnionPay | 62, outside the Discover range | 16 to 19 |
| Diners Club | 300 to 305, 36, 38, 39, 3095 | 14 to 19 |
| Maestro | 5018, 5020, 5038, 5893, 6304, 6759, 6761 to 6763, other 50 and 56 to 58 starts | 12 to 19 |
| Any other start | No listed network | 12 to 19 |
Lengths come from the Wikipedia table of payment card numbers. A number must have a length from its row and pass the Luhn check digit to show Valid Number.
What the tool says for some example numbers
| Number typed | Result | Message under it |
|---|---|---|
| 4111 1111 1111 1111 | Valid Number, Visa | 16 digits, and the check digit matches. |
| 5555 5555 5555 4444 | Valid Number, Mastercard | 16 digits, and the check digit matches. |
| 3782 822463 10005 | Valid Number, American Express | 15 digits, and the check digit matches. |
| 4242 4242 4242 4243 | Invalid Number | The check digit does not match, so the number is mistyped or made up. |
| 4111 1111 1111 111 | Invalid Number | Visa numbers have 13, 16 or 19 digits. This one has 15. |
| 4111111111111111111111 | Invalid Number | Visa numbers have 13, 16 or 19 digits. This one has 22. |
| 0000 0000 0000 0000 | Invalid Number | A card number cannot be all zeros. |
Example numbers only. The tool shows the network name only when the number is valid. A number of 12 to 19 digits that passes the check digit but starts with no listed prefix shows Valid Number with Unknown network.
How to use this tool
- Type or paste the card number. Spaces and dashes are ignored, and a result appears from 12 digits.
- Read the result: Valid Number with the network name, or Invalid Number with the reason underneath.
- Use Clear number to remove what you typed.
Frequently asked questions
- How do I check if a credit card number is valid?
- Type or paste the number. Spaces and dashes are ignored, and a result appears from 12 digits. The tool checks, in order, that the number is not all zeros, that its length fits the network its first digits point to, and that the Luhn check digit matches. 4111 1111 1111 1111 shows Valid Number and Visa, with the message "16 digits, and the check digit matches."
- What is the Luhn algorithm?
- A check-digit rule: from the right, double every second digit, subtract 9 from any result above 9, add all the digits, and the total must be a multiple of 10. For 4111111111111111 the total is 30, so it passes; with the last digit changed to 2 it is 31 and fails. It catches every single-digit error and almost every swap of two adjacent digits (09 and 90 slip through). It protects against typing mistakes, not against someone building a number on purpose.
- How many digits does a credit card number have?
- The general rule on the Wikipedia page for payment card numbers is 8 to 19 digits. This tool is stricter by network: Visa 13, 16 or 19, Mastercard 16, American Express 15, Diners Club 14 to 19, Discover, JCB and UnionPay 16 to 19, Maestro 12 to 19. A number that matches no listed network must have 12 to 19 digits.
- Does a valid result mean the card is real?
- No. About one string of digits in ten has a matching check digit, so passing the Luhn test says little about whether an account exists. The tool does not contact a bank or a card network, and it has no field for an expiry date or security code, so it cannot tell whether a card is active, blocked or has funds.
- Why does it say the check digit does not match?
- One digit is wrong, or two were swapped. 4242 4242 4242 4242 passes, while 4242 4242 4242 4243 fails with "The check digit does not match, so the number is mistyped or made up." Compare the digits with the card. A number made up at random fails this test about nine times in ten, even when its length is right.
- Should I type a real card number into a validator?
- You do not need to. The check works on the digits alone, so an example number such as 4111 1111 1111 1111 shows how it behaves. This tool asks for neither an expiry date nor a security code, and no tool that checks only a format needs them.
Related Tools
View all toolsBasic Calculator
Basic calculator for + − × ÷ in the standard order of operations (2 + 3 × 4 = 14), with % and memory keys, ^ for powers and the result as a fraction.
Simple Interest Calculator
Simple interest calculator using I = P × r × t. Enter the principal, annual rate and a time in years, months or days to get the interest and the total.
Mortgage Calculator
Monthly principal-and-interest payment on a fixed-rate mortgage from the loan amount, or home price and down payment, plus the total paid and total interest.
Mortgage Amortization Schedule Calculator
Mortgage amortization schedule for a fixed-rate loan: interest, principal and balance each month, with an optional extra payment and yearly totals.
Retirement Calculator
Project retirement savings from your age, balance, monthly saving and return, and compare them in today’s dollars with the 4% rule and what lasts to age 90.
Inflation Calculator
See what an amount will cost in the future at an inflation rate you assume, and what it will buy in today’s money. No historical or CPI data: you set the rate.