Credit Card Validator (Luhn Check)
Paste a card number to check whether it passes the Luhn checksum and to see the detected card type. Everything runs locally in your browser, so the number you enter never leaves your device.
How to validate a credit card number
- Type or paste the card number. Spaces and dashes are ignored as you go.
- Watch the valid or invalid badge update live, along with the detected card type.
- Use the formatted output and Copy button if you need a clean, grouped number.
Examples
A valid Visa test number
4242 4242 4242 4242
valid: true, cardType: Visa, length: 16
A number that fails the Luhn check
4242 4242 4242 4241
valid: false, cardType: Visa
Frequently asked questions
What does this credit card validator actually check?
It checks the structure of the number only: that it passes the Luhn checksum and has 12 to 19 digits, and it guesses the brand from the leading digits. It does not check whether the card is real, active, or has any funds. A valid result just means the number is well-formed.
What is the Luhn algorithm?
The Luhn algorithm, or mod 10 check, is a simple checksum used by most payment cards. It doubles every second digit from the right, sums all the digits, and the number is valid when that total is a multiple of 10. It catches most accidental typos but is not a security feature.
How is the card type detected?
The card type comes from the issuer identification number, the first few digits of the card. For example numbers starting with 4 are Visa and 34 or 37 are American Express. The brand is detected from the prefix even when the number itself fails the Luhn check.
Is my card number sent anywhere or stored?
No. All validation happens locally in your browser using client-side JavaScript. The number you type is never uploaded, logged, or stored, so it never leaves your device.
Should I enter a real credit card number here?
There is no need to. The tool is designed for testing card-handling code and forms, so use the published test numbers from Visa, Mastercard, and others. Because validation only proves the format is correct, entering a real number tells you nothing extra.
Why is a correctly typed card number reported as invalid?
Either a digit is wrong so the Luhn checksum no longer adds up, or the length falls outside the 12 to 19 digit range. Double-check each digit. Remember that passing this check still does not guarantee the card can be charged.
Related tools
IBAN Validator
Validate an IBAN with the ISO 13616 mod-97 checksum. Paste an account number to verify the country, check digits and length, all in your browser.
Routing Number Validator
Validate a US bank routing number. Check the 9-digit ABA checksum, see if it passes, and read the Federal Reserve district from the first two digits.
IMEI Validator
Validate a 15-digit IMEI with the Luhn checksum. Paste an IMEI to see if it is valid and read its TAC, serial number and check digit. Runs in your browser.
UUID Validator
Validate a UUID and detect its version and variant. Paste a UUID or GUID, see if the format is valid, and read its version, variant and nil status.
BIC / SWIFT Validator
Validate a BIC or SWIFT code against ISO 9362. Check the format and country, then read the bank, country, location and branch parts of the code.
EAN / UPC Validator
Validate EAN-13, UPC-A and EAN-8 barcodes in your browser. Check the GS1 mod-10 check digit, see the type, or compute the check digit for a partial code.