Credit Card Validator: Verify Card Numbers
Our credit card validator uses the Luhn algorithm to check if a card number is mathematically valid. It also detects the card type (Visa, Mastercard, American Express, etc.) and formats the number for display.
This tool is designed for developers testing payment systems, not for validating real transactions. All validation happens locally in your browserโwe never store or transmit card numbers.
The Luhn Algorithm
The Luhn algorithm (also known as "modulus 10" or "mod 10") is a simple checksum formula used to validate identification numbers like credit card numbers. It works by:
- Starting from the rightmost digit, double every second digit
- If doubling results in a number greater than 9, subtract 9
- Sum all the digits
- If the total modulo 10 equals 0, the number is valid
Card Type Detection
Visa: Starts with 4, length 13-16-19 digits
Mastercard: Starts with 51-55 or 2221-2720, length 16 digits
American Express: Starts with 34 or 37, length 15 digits
Discover: Starts with 6011 or 65, length 16-19 digits
Diners Club: Starts with 300-305 or 36 or 38, length 14-16 digits
JCB: Starts with 3528-3589, length 16-19 digits
What is BIN/IIN?
The first 6-8 digits of a card are called the Bank Identification Number (BIN) or Issuer Identification Number (IIN). These digits identify the institution that issued the card, the card type, and the country of origin.
FAQ
Is my card number stored?
No. All validation happens locally in your browser using JavaScript. Card numbers are never sent to our servers, stored, or logged.
Why might a valid-looking number fail validation?
The number might have a typoโeven a single incorrect digit will cause the Luhn check to fail. The check digit (last digit) is specifically designed to catch transcription errors.