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), and, from the IIN Range Summary that Discover Global Network publishes for its acceptance network, Discover (6011 and 6440–6589; 16–19 digits), Diners Club (3000–3059, 3095 and 38–39 with 16–19 digits, 36 with 14–19), JCB (3088–3094, 3096–3102, 3112–3120, 3158–3159, 3337–3349 and 3528–3589; 16–19) and the UnionPay ranges that list carries (6210 94, 6221 26–6237 96, 624–626, 6282–6288 and 8100–8171; 16–19). Those ranges are compared on the first eight digits. The result shows the network by name (Visa, Mastercard, American Express, Discover, Diners Club, JCB, UnionPay or Unknown), the digit count, and Yes/No answers for the length check (Not checked when the network is Unknown, as there is no length rule to apply) 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 ranges listed (other UnionPay ranges, Maestro, RuPay and local schemes are not in the table); the number may still pass Luhn, and Length valid shows Not checked (unknown network).
  • 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.

Sources

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 644–658, 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.

Note from the editors

Test with the published sample numbers, not a real card. A network shown as Unknown does not mean the number is bad: the check knows Visa, Mastercard and American Express by their prefixes and Discover, Diners Club, JCB and part of UnionPay from Discover's own IIN range list, so Maestro, RuPay and other UnionPay ranges show as Unknown. A pass on length and Luhn shows only that the digits are well-formed, not that an account exists. Which card networks should be recognized that are missing now?

Comments

  • Be the first to comment.

Popular calculators

All Calculators