Dev Tools

Credit Card Validator

Validate credit card numbers using the Luhn algorithm. Detect card type (Visa, Mastercard, Amex, Discover, JCB, Diners Club) by prefix.

Card number
Validation

Enter a card number to validate.

Supported Card Types
Visa
Prefix: 4 | 13, 16, 19 digits
Mastercard
Prefix: 51-55, 2221-2720 | 16 digits
American Express
Prefix: 34, 37 | 15 digits
Discover
Prefix: 6011, 622126-622925, 644-649, 65 | 16, 19 digits
JCB
Prefix: 3528-3589 | 16, 17, 18, 19 digits
Diners Club
Prefix: 300-305, 36, 38 | 14, 16, 19 digits
UnionPay
Prefix: 62 | 16, 17, 18, 19 digits
Maestro
Prefix: 5018, 5020, 5038, 6304, 6759, 6761-6763 | 12, 13, 14, 15, 16, 17, 18, 19 digits

Related tools

About Credit Card Validator

Check whether a credit card number is structurally valid using the Luhn checksum, and identify its card network (Visa, Mastercard, American Express, Discover, JCB, Diners Club, UnionPay, or Maestro) from its prefix and length. Useful for validating test numbers, debugging payment form logic, or checking a number was typed correctly — nothing here verifies whether a card is real, active, or has funds.

How to use

  1. Type or paste a card number into the input (spaces and dashes are ignored).
  2. Read the Luhn check, length check, and detected card type.
  3. Use the IIN/BIN and last-four breakdown to confirm the number matches what you expect.

Frequently asked questions

Is my card number sent to a server?
No. The Luhn check and card-type detection run entirely in your browser using JavaScript — nothing is transmitted or stored anywhere, including by this site.
Does a passing check mean the card is real or has money on it?
No. Luhn is just a checksum built into how card numbers are generated; it catches typos and malformed numbers but says nothing about whether the account exists, is active, or has available funds.
Why does it say a valid-looking number is invalid?
Either the digit count does not match what that card network uses, or the checksum digit is wrong — often a sign of a typo or a fabricated (non-Luhn) test number.