Card BIN Format Checker

Enter a card number to check its network, length and Luhn validity.

Result

Visa
16 digits
Yes
Yes

How it is calculated

The tool removes everything that is not a digit, so spaces and hyphens are fine. It then looks at the leading digits to pick a network and its allowed lengths: Visa (starts with 4; 13, 16 or 19 digits), Mastercard (51–55 or 2221–2720; 16), American Express (34, 37; 15), Discover (6011, 65; 16 or 19), Diners (36, 38, 300–305; 14–19) and JCB (3528–3589; 16–19). The result shows the network by name (Visa, Mastercard, American Express, Discover, Diners Club, JCB or Unknown), the digit count, and Yes/No answers for the length check and the Luhn check. Luhn: from the right, double every second digit, subtract 9 from any result over 9, add all digits; the sum must be divisible by 10. Passing both checks only proves the number is well formed, not that a card exists or is active.

Worked example

Enter 4111 1111 1111 1111. Without spaces it has 16 digits (shown as "16 digits"). It starts with 4, so the network is Visa, and 16 is an allowed Visa length, so Length valid shows Yes. For Luhn, double every second digit from the right: the leading 4 becomes 8 and each of the seven doubled 1s becomes 2, giving 8 + 14 = 22. The eight undoubled digits are 1 each, giving 8. The total 22 + 8 = 30 is divisible by 10, so Luhn valid shows Yes.

Try this example →

Common mistakes

  • Reading a pass as proof that the card is real. The checks cover only the prefix, length and checksum; they say nothing about the account, expiry or funds.
  • Expecting Unknown to mean an invalid card. Unknown only means the prefix matches none of the six networks listed; the number may still pass Luhn.
  • Changing one digit and expecting the network to change. Only the leading digits decide the network, but any single wrong digit anywhere usually turns the Luhn check to No.
  • Typing a card number with letters or a CVV mixed in. Non-digits are stripped silently, so extra digits change the length and the checksum. Enter only the card number.
  • Assuming Length valid = Yes means a correct checksum. The two checks are independent: a number can have the right length and still fail Luhn, or the reverse.

About this calculator

The first 6–8 digits of a payment card number — its BIN/IIN (Bank/Issuer Identification Number) — encode the card network and issuing bank: Visa numbers start with 4, Mastercard with 51–55 or 2221–2720, American Express with 34 or 37, Discover with 6011 or 65, and so on, each network also fixing an expected total card length. The final digit is a check digit computed with the Luhn algorithm, which doubles every second digit from the right, sums the digits, and requires the total to be a multiple of 10.

This checker reads the BIN prefix to identify the network, confirms the number length matches that network's standard, and runs the Luhn check — all without validating that the card is real, active, or has any funds. Payment developers testing checkout flows, and fraud-review or support staff use it to catch obviously malformed or mistyped card numbers before they ever reach a payment processor.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    Test with the published sample numbers, not a real card. Also, a network shown as Unknown does not mean the number is bad, since this check covers only six common networks and some other card ranges, such as UnionPay, are not recognised. A pass on length and Luhn shows only that the digits are well-formed, not that an account exists. Which card networks should be recognised that are missing now?

Popular calculators

All Calculators