A BIN, short for bank identification number and formally called the IIN (issuer identification number), is the leading block of digits on a payment card that identifies the card network and the issuing institution. In e-commerce payment security, the BIN is the first piece of card data that merchants, gateways and fraud tools read, because it reveals the issuer, country, card type and product level before any authorization takes place.
The BIN does not identify the cardholder and is not secret on its own. Its value lies in the metadata it unlocks through BIN databases, which feed routing decisions, fraud screening rules and checkout logic.
How the BIN is structured within a card number
A payment card number, the primary account number (PAN), follows the international standard ISO/IEC 7812. The PAN usually has 15 to 19 digits and contains three parts: the BIN at the start, an individual account identifier in the middle and a check digit at the end calculated with the Luhn algorithm.
| Component | Position | Purpose |
|---|---|---|
| Major industry identifier | First digit | Indicates the industry, for example 4 and 5 for banking and finance |
| BIN or IIN | First 6 or 8 digits | Identifies network, issuer and card program |
| Account identifier | Following digits up to the last | Identifies the individual account |
| Check digit | Last digit | Detects typing errors through the Luhn formula |
Historically, BINs were six digits long. Because the supply of six-digit ranges was running out, the 2017 revision of ISO/IEC 7812 introduced eight-digit BINs, and the major networks began issuing them broadly around April 2022. Systems that still assume six digits may misclassify cards, so modern BIN lookups should accept both lengths.
What a BIN lookup reveals
A BIN lookup maps the leading digits to issuer attributes stored in tables maintained by card networks and commercial data providers. Merchants rarely see the official network tables directly; they usually consume them through their payment gateway or processor, which refreshes the data regularly.
| Attribute | Example value | How it is used |
|---|---|---|
| Card network | Visa, Mastercard, American Express | Routing, logo display, fee calculation |
| Issuing bank | Name of the issuer | Support contact, issuer-specific rules |
| Issuing country | Country code of the issuer | Geographic risk checks, cross-border fees |
| Funding type | Credit, debit, prepaid | Fraud rules, payment method restrictions |
| Product level | Classic, premium, commercial | Interchange cost, corporate card handling |
| Regulatory flags | Strong authentication requirements | Deciding whether to request 3-D Secure |
Leading digits also indicate the network without any lookup: Visa cards start with 4, Mastercard uses 51 to 55 and 2221 to 2720, and American Express uses 34 and 37. Checkout forms rely on this to show the correct card logo while the shopper types.
The role of the BIN in fraud screening
The BIN is a core input for fraud screening and fraud risk scoring because it supplies context that the shopper cannot easily falsify. A strong signal is a BIN country mismatch, where the issuing country differs sharply from the billing address, shipping address and IP location.
| Signal | What it may indicate | Typical response |
|---|---|---|
| Country mismatch | Stolen card used from abroad | Raise risk score, request 3-D Secure |
| Prepaid card on high-value order | Anonymous funding to avoid traceability | Manual review or order limit |
| Many attempts from one BIN range | Card testing or BIN attack | Velocity check and temporary block |
| BIN with high chargeback history | Weak issuer controls | Stricter rules for that range |
| Corporate card on consumer goods | Possible misuse of a company card | Additional verification |
A particular threat is the BIN attack, a form of card testing in which criminals take a known BIN and generate the remaining digits, often with valid Luhn check digits, then submit small authorization attempts until some succeed. Defenses include velocity limits per BIN range, CAPTCHA on repeated failures and monitoring of decline ratios. The BIN alone never proves fraud; it should be one feature among many.
BIN data in payment routing and checkout
Beyond fraud prevention, BIN data supports payment optimization. Merchants with several acquirers can route a transaction to a local acquirer in the issuing country, which often improves approval rates and lowers cross-border fees. In regions where debit cards carry more than one network, the BIN helps determine which network can process the payment at the lowest cost.
- Surcharging rules: some jurisdictions forbid surcharges on debit cards, so the funding type from the BIN decides what may be charged.
- Payment method eligibility: subscriptions may reject prepaid cards that cannot support recurring charges.
- Strong customer authentication: the issuer region helps determine whether 3-D Secure is required under rules such as PSD2 in Europe.
- Network tokenization: tokens keep a BIN-like prefix so routing and analytics still work.
BIN handling under PCI DSS and common mistakes
Under PCI DSS, the BIN is part of the PAN, but the standard permits displaying a truncated number that shows the leading digits and the last four digits. Version 4 recognizes that eight-digit BINs require showing up to the first eight digits in certain cases, subject to the rules of each card brand. Storing the BIN separately for analytics is generally acceptable, while storing the full PAN brings the system into full PCI scope.
| Mistake | Consequence | Fix |
|---|---|---|
| Hard-coded six-digit logic | Wrong issuer or card type | Support six- and eight-digit lookups |
| Outdated BIN tables | New ranges misclassified | Refresh data at least monthly |
| Blocking whole countries by BIN | Lost legitimate sales | Combine BIN with other signals |
| Treating BIN as cardholder identity | Wrong fraud conclusions | Use it only as issuer context |
The idea in brief
The first few digits of a payment card work like the area code of a phone number. They do not say who owns the card. They do tell an online store which bank issued it and in which country. They also show whether it is a credit, debit or prepaid card.
Stores use this information to spot suspicious orders. A card from one country used with an address on another continent looks odd. The digits also help send the payment along the cheapest and most reliable path.
A practical scenario
A mid-sized online electronics retailer notices that over one night its checkout receives several thousand $1 authorization attempts, almost all declined. The payment team groups the attempts by BIN and finds that most of them share the same eight-digit prefix, a classic sign of a BIN attack in which fraudsters generate card numbers and test which ones are live.
The team adds a velocity rule that allows only a small number of failed attempts per BIN range per hour and requires a CAPTCHA after two declines. It also enables 3-D Secure for any order where the BIN country differs from both the IP and shipping country. Within a day, the testing traffic stops, the decline ratio returns to normal and the retailer avoids penalties for excessive authorization failures.