BIN Lookup Explained: How to Identify a Card from Its First Digits

BIN/IIN lookup explained: how a card's first 6-8 digits map to network, issuer, country, and type, plus network ranges and the 8-digit migration.

By FakeName Editorial TeamPublished June 25, 2026Last updated June 26, 20269 min read

Every payment card begins with a short numeric prefix that tells software a great deal before a single authorization request is sent. That prefix is the BIN. A bin lookup decodes it into the card network, the issuing bank, the country, and the product tier. For developers building checkout flows, fraud filters, or analytics pipelines, reading the BIN correctly is the difference between routing a transaction to the right processor and silently dropping revenue.

This guide explains how BIN and IIN lookups work, what the digits actually reveal, and how the 2022 migration to 8-digit BINs changed the rules. It pairs with our deeper breakdown of card anatomy at /blog/credit-card-number-structure, and the worked validation logic in /tools/credit-card-validator.

What is a BIN number and what does a BIN lookup do?

A BIN (Bank Identification Number) is the leading 6-to-8 digits of a payment card that identify its issuer and network. A BIN lookup maps that prefix against a card BIN database to return the network, issuing bank, country, and card type. It reads only metadata, never the account holder or balance, because none of that is encoded in the prefix.

Under ISO/IEC 7812, the standard that defines card numbering, the prefix is officially the IIN (Issuer Identification Number) [iso-7812]. The term BIN predates the standard and survives in payment tooling, so an iin lookup and a bin lookup describe the same operation. The full card number is a Primary Account Number (PAN) of up to 19 digits: the IIN, an individual account identifier, and a single check digit computed with the Luhn algorithm [iso-7812].

PAN componentDigit positionLengthWhat it encodes
Major Industry Identifier (MII)Digit 11 digitBroad category, e.g. 4 = banking/financial (Visa), 3 = travel/entertainment (Amex, Diners).
Issuer Identification Number (IIN/BIN)Digits 1-6 or 1-86 or 8 digitsNetwork and issuing institution; the only part a BIN lookup matches. Includes the MII as its first digit.
Individual account identifierAfter the IIN to the second-to-last digitUp to ~12 digitsIssuer-assigned account number; not derivable from a lookup and unique to the cardholder's account.
Check digitLast digit1 digitLuhn checksum over all preceding digits; validates structure only, not authorization.
Anatomy of a Primary Account Number (PAN) under ISO/IEC 7812-1:2017. The BIN/IIN is only the leading segment; a lookup reads it and ignores the rest.

Which card network does a BIN belong to?

The first digit of a BIN, the Major Industry Identifier, plus the leading range identify the network. Visa cards start with 4; Mastercard uses 51-55 and the newer 2221-2720 range; American Express uses 34 and 37; Discover, JCB, and UnionPay occupy their own assigned blocks. A lookup matches the longest prefix first, then narrows to the issuer.

NetworkLeading BIN rangeTypical PAN length
Visa416 (some 13, 19)
Mastercard51-55, 2221-272016
American Express34, 3715
Discover6011, 644-649, 6516 (up to 19)
JCB3528-358916-19
UnionPay62, 8116-19
Diners Club300-305, 36, 38-3914-19
Maestro50, 56-69 (varies)12-19
Major network BIN ranges and PAN lengths (per ISO/IEC 7812 MII assignments and network specifications).

The Mastercard 2221-2720 block was activated in 2017 to expand capacity, and any lookup written before then will misclassify those cards [mc-2series]. American Express documents 34 and 37 as its account prefixes with a fixed 15-digit PAN [amex-numbering]. Discover publishes its acquirer ranges including 6011, 622126-622925, 644-649, and 65 [discover-ranges].

The issuer identification number (IIN) is the first six or eight digits of the primary account number, used to identify the issuer of the card.
ISO/IEC 7812-1:2017, Identification cards — Identification of issuers

What does a BIN reveal about a card?

A BIN reveals issuer-level attributes only: the card network, the issuing bank or institution, the country of issuance, the card type (debit, credit, prepaid, charge), and often the product tier (standard, gold, platinum, commercial). It never exposes the cardholder name, balance, expiry, or full account number, since those are not derivable from the prefix.

AttributeReturned by lookup?Notes
Card network (scheme)YesFrom the leading range, e.g. 4 = Visa.
Issuing bank / institutionYesMapped from the issuer's registered BIN block.
Country of issuanceYesDrives currency, tax, and compliance logic.
Card type (debit/credit/prepaid)YesAffects interchange and surcharge rules.
Product tier (gold/platinum/commercial)OftenCoverage varies by BIN database quality.
Cardholder nameNoNot encoded in the PAN.
Account balance / credit limitNoHeld only by the issuer.
Full card number / CVVNoNever derivable from the BIN.
Data a BIN lookup can and cannot return.

How do developers use BIN data in production?

  • Transaction routing: send a card to the cheapest or most reliable processor for its network and country.
  • Surcharge and interchange logic: apply different fees to credit vs. debit, or commercial vs. consumer cards.
  • Fraud screening: flag a mismatch between the BIN's issuing country and the shipping or IP geolocation [visa-fraud].
  • Analytics: segment authorization rates and chargebacks by issuer, country, and tier.
  • Checkout UX: display the correct network logo and apply the right input mask as the user types.

Why did BINs change from 6 to 8 digits?

Payment networks migrated from 6-digit to 8-digit BINs starting in April 2022 because the 6-digit space was running out. An 8-digit IIN expands the pool of assignable issuer identifiers roughly a hundredfold, letting networks keep issuing unique blocks. ISO/IEC 7812 was updated in its 2017 revision to permit the longer 8-digit IIN [iso-7812].

Aspect6-digit (legacy)8-digit (current)
Standard basisISO/IEC 7812 (pre-2017)ISO/IEC 7812-1:2017
Effective fromOriginal numberingApril 2022 network rollout
Issuer pool size~1 million blocks~100 million blocks
Lookup digits to readFirst 6First 8 (fall back to 6 for legacy data)
Impact on PAN lengthNoneNone — total PAN unchanged
The 6-digit to 8-digit BIN migration at a glance.

Mastercard and Visa both published mandates directing acquirers and processors to support 8-digit BINs by the April 2022 deadline [mc-8digit]. The practical rule for engineers: index your card BIN database on the full 8 digits, and when a record only carries 6, treat the trailing two as a wildcard. Truncating an 8-digit BIN to 6 can merge two distinct issuers and corrupt routing or fraud logic.

How should a BIN checker handle both lengths?

  1. Read the first 8 digits of the PAN as the candidate BIN.
  2. Query the database for an exact 8-digit match first.
  3. If no 8-digit record exists, fall back to a 6-digit prefix match.
  4. Resolve ties by longest-prefix-wins so specific issuer blocks override broad ranges.
  5. Cache results and refresh the dataset on the publisher's schedule, since BIN assignments change.

How do you test BIN logic without real card numbers?

Test BIN logic with reserved sandbox ranges that pass structural and Luhn checks but were never issued to real accounts. FakeName generates card numbers from these never-issued blocks so QA teams can exercise validators, routing rules, and form masks safely. The numbers are fictional by construction and are declined by every live authorization network.

Hardcoding a colleague's real card into a test fixture is a data-handling incident waiting to happen. Synthetic BINs remove that exposure entirely. They let you assert that your bin checker classifies a Visa prefix as Visa, that an 8-digit lookup beats a 6-digit fallback, and that a country-mismatch rule fires, all without touching cardholder data or triggering PCI DSS scope on a test environment [pci-dss].

Worked example: a generated number begins 4 0 1 2 8 8. The leading 4 marks the Major Industry Identifier for banking and the Visa network. Reading all 8 digits (4 0 1 2 8 8 8 8) gives the candidate BIN your lookup should query first. Validate the complete PAN with the Luhn check documented at /tools/credit-card-validator, and see how the remaining digits form the account identifier in /blog/credit-card-number-structure.

Key takeaways for developers

  • A BIN/IIN is the leading 6-8 digits identifying network, issuer, country, and card type, per ISO/IEC 7812.
  • A lookup returns metadata only — never names, balances, or full PANs.
  • Read 8 digits first and fall back to 6; the migration deadline was April 2022.
  • Use BIN data as a weighted fraud and routing signal, not a final verdict.
  • Test with reserved sandbox BINs from FakeName, never real cards, to stay out of PCI scope.

References & sources

  1. ISO/IEC 7812-1:2017 — Identification cards: Identification of issuers, Part 1: Numbering systemInternational Organization for Standardization
  2. Mastercard 2-series BIN range (222100-272099) program guidanceMastercard
  3. Mastercard 8-digit BIN migration — acquirer and processor mandateMastercard
  4. American Express card number structure and account prefixes (34, 37)American Express
  5. Discover Network acquirer card identification rangesDiscover Global Network
  6. Visa Core Rules and risk management guidanceVisa
  7. PCI DSS v4.0 — Requirements and Testing ProceduresPCI Security Standards Council

Frequently asked questions

What is a BIN number?+

A BIN (Bank Identification Number) is the leading set of digits on a payment card that identifies the issuing institution and network. ISO/IEC 7812 formally calls it the IIN (Issuer Identification Number). It historically spanned the first 6 digits and now extends to 8 digits.

Is a BIN the same as an IIN?+

Functionally yes. IIN (Issuer Identification Number) is the term defined in ISO/IEC 7812. BIN (Bank Identification Number) is the older industry name still widely used in payments tooling. The two refer to the same leading digits, though IIN is the standards-compliant term.

How many digits is a BIN?+

A BIN was traditionally 6 digits. Visa, Mastercard, and other networks migrated to 8-digit BINs starting April 2022 to expand the available number space. Lookups should now read up to 8 digits, falling back to 6 for legacy data.

Can a BIN lookup reveal the cardholder's name or balance?+

No. A BIN lookup returns only issuer-level metadata: network, bank, country, card type, and tier. It never exposes the cardholder's name, account balance, full card number, or any personally identifiable information, because that data is not encoded in the BIN.

What can I use a BIN checker for legitimately?+

Common uses are routing transactions to the correct processor, applying surcharge or interchange logic by card type, geolocating the issuing country for compliance, and scoring fraud risk. For testing, use reserved sandbox BINs that were never issued to real accounts.

Do FakeName test BINs work in production payment systems?+

No. FakeName generates card numbers from reserved, never-issued, and sandbox ranges that pass structural and Luhn checks but are rejected by live authorization networks. They exist for QA, form validation, and integration testing, never for real transactions.

We use cookies for analytics and ads to keep this generator free. See our Privacy Policy.