Security

BIN Numbers: What Issuer Prefixes Reveal About Payment Cards

October 12, 2025 · 6 min read · By Yasir Khan

← Back to Blog

Every payment card number starts with a short block of digits that says who is responsible for the card. Payments professionals call this block the Bank Identification Number (BIN), or more formally the Issuer Identification Number (IIN). It is the reason a checkout form can show a Visa or Mastercard logo after you have typed only a few digits. This guide explains what those digits mean and, just as importantly, what they do not.

The anatomy of a card number

The ISO/IEC 7812 standard divides a card number, formally called the primary account number (PAN), into three parts:

  1. The issuer identification number. The leading digits that identify the card issuer.
  2. The individual account identifier. The middle digits, assigned by the issuer to a specific account.
  3. The check digit. The final digit, calculated with the Luhn algorithm so that typing mistakes can be spotted.

Card numbers can be up to 19 digits long, although the great majority of cards in daily use have 15 or 16.

The first digit: major industry identifier

The very first digit is the major industry identifier (MII). It tells you the broad sector of the issuer rather than a specific company:

  • 1 and 2: airlines and other future industry assignments (the 2 now also appears in a Mastercard range)
  • 3: travel and entertainment, which includes American Express, Diners Club and JCB
  • 4 and 5: banking and financial services, which covers Visa and most Mastercard numbers
  • 6: merchandising and banking, used by Discover, UnionPay, RuPay and others
  • 7: petroleum
  • 8: healthcare and telecommunications
  • 9: national assignment by standards bodies

From the next few digits onward, the prefix narrows down to a specific network and then to a specific issuer. A Visa number always starts with 4. Mastercard numbers start with 51 to 55 or fall in the 2221 to 2720 range. American Express numbers start with 34 or 37.

From six digits to eight

For decades the BIN was six digits long, and many articles and tools still say so. As the number of issuers, fintech programs and prepaid products grew, six digits no longer left enough room to assign unique ranges. The standard was therefore revised to allow eight-digit issuer prefixes, and the card networks moved to eight-digit BINs. In practice this means that a system which stores or compares only the first six digits can now mix up two different issuers. When you design a lookup, plan for eight digits, and fall back to six only when no longer match exists.

What a prefix can tell you

With a commercial or network-supplied BIN table, a business can usually learn:

  • the card network or scheme (for example Visa, Mastercard or Discover),
  • the issuing institution and the country where it operates,
  • whether the product is credit, debit or prepaid, and
  • in many cases the product tier, such as a standard or premium card.

Retailers and payment processors use this information for entirely legitimate purposes. It lets them route a transaction to the right network, display the correct logo, apply the right fee estimate, and notice when a card issued in one country is being used in a way that looks out of pattern for the order.

What a prefix cannot tell you

A prefix identifies a range of numbers, not a particular card. It cannot confirm that a card exists, that an account is open, that there are funds, or who holds it. Co-badged cards add another wrinkle: a single card can carry a national debit brand and an international brand, but both usually share one number that looks like the international network’s.

It is also worth being clear about what a free format checker can do. Tvalidora reads the public prefix ranges to identify the card network and the expected length, then applies the checksum. It does not look up the issuing bank, the product tier or whether a card is debit or credit, because that data lives in the issuers’ own tables rather than in the number itself. Our FAQ goes into this in more detail.

Handling prefix data responsibly

A BIN on its own is not usually considered sensitive, but a full card number absolutely is. The Payment Card Industry Data Security Standard (PCI DSS) limits how many digits of a card number may be shown or stored in readable form, with the BIN and the last four digits being the most that may appear together. You can read the current requirements on the PCI Security Standards Council website.

That has a practical consequence for developers. If you only need the network or issuer to display a logo or choose a processing route, send or log only the leading digits and never the whole number. Better still, perform the check in the browser so that nothing leaves the customer’s device. The format checks on our validator work this way for card numbers.

A quick prefix example in code

A very small detector can use ranges rather than exact strings. The longest matching prefix should win, because narrower ranges sit inside broader ones:

const rules = [
  { name: "Visa",       test: n => n.startsWith("4") },
  { name: "Amex",       test: n => /^3[47]/.test(n) },
  { name: "Mastercard", test: n => {
      const p2 = Number(n.slice(0, 2));
      const p4 = Number(n.slice(0, 4));
      return (p2 >= 51 && p2 <= 55) || (p4 >= 2221 && p4 <= 2720);
  } },
];

function detectNetwork(digits) {
  return rules.find(r => r.test(digits))?.name ?? "Unknown";
}

Real implementations add many more networks and use length rules as well, which is the subject of our guide to international card schemes.

Key takeaways

  • The BIN, or IIN, is the leading block of a card number that identifies the issuer, and it is now commonly eight digits rather than six.
  • The first digit tells you the industry, and the next few narrow it to a network.
  • A prefix describes a range, not a person or an account, so it can never prove that a card is real or usable.
  • Treat full card numbers as highly sensitive, and use as few digits as your task requires.

Put it into practice: check the format of a card, routing or account number with the Tvalidora validator, look up an area code or zip code with the US Checker, or read the FAQ to see exactly what a “valid” result means. Tvalidora checks number format only, and never stores what you enter.

Keep reading