Credit Card Validator
Validate card numbers and identify brands
Validation result
- Card brand
- Not detected
- Formatted number
-
- Valid lengths
- Not detected
- Security code
- Not detected
Validation checks
- Brand Not detected
- Length Not detected
- Luhn Not detected
What is Credit Card Validator?
Credit Card Validator checks the brand, length, and Luhn checksum of a credit card number. It identifies whether a number matches a brand such as Visa or Mastercard, whether it has a valid length, and whether its check digit is correct. All processing runs in your browser.
Entered card numbers are validated only by this page. They are never sent over the network.
How to Use
- Enter a credit card number. Spaces and hyphens are allowed.
- Review the result and the brand, length, and Luhn details.
The number is formatted with the brand's grouping as you type. The result updates as you type, and the status is one of incomplete, invalid, or valid.
Reading the Result
- Valid: the brand is identified, and both the length and Luhn check pass.
- Incomplete: the number is shorter than the required length or is between allowed lengths. Keep typing to update the result.
- Invalid: the input contains characters other than digits, the length is not allowed, the Luhn check fails, or the brand is not supported.
Open the Luhn details to see the transformed digits, the sum, and the remainder after dividing by 10.
Test Numbers
Use the following numbers for testing. They are test numbers, not real cards.
| Brand | Number |
|---|---|
| Visa | 4242424242424242 |
| Mastercard | 5555555555554444 |
| American Express | 378282246310005 |
| JCB | 3530111333300000 |
| Diners Club | 30000000000004 |
| Discover | 6011000990139424 |
| UnionPay | 6200000000000005 |
| Luhn failure example | 4242424242424241 |
You can also load them from the test numbers in the tool.
Use Cases
- Confirming that test card numbers match a brand's rules
- Narrowing down whether a length or Luhn issue is causing a problem during debugging
About the Luhn Algorithm
The Luhn algorithm validates the check digit of a card number. Starting from the right, every second digit is doubled. If the result is greater than 9, 9 is subtracted, and the values are summed. The number passes when the sum is divisible by 10.
It helps detect input mistakes, but passing the Luhn check does not mean the card is real or usable.
Things to Keep in Mind
- This tool checks the structure of the number only. It does not verify the expiry date, security code, balance, or whether the card can be used.
Last updated:

