basics · 2025-01-13 · 6 min read
Anatomy of a card number (PAN): issuer, account and check digit
The 16 digits on a card are three fields in disguise. Understanding them explains why forms can detect Visa after four keystrokes and why lengths vary from 12 to 19.

PAN stands for Primary Account Number — the long number embossed or printed on a payment card. Although it reads as one string, it is defined by ISO/IEC 7812 as three distinct fields. Type any number into the ranges section and the site colours each field for you.
1. Issuer Identification Number (IIN)
The first six digits (now extended to eight) identify the issuing institution and often the product — debit, credit, prepaid, commercial. Networks reserve leading digits: 4 for Visa, 51–55 and 2221–2720 for Mastercard, 34/37 for American Express. This is why a form can show the right logo after a few digits; our network prefixes cheat-sheet lists them all. The older name for this field is BIN — see IIN vs. BIN.
2. Individual account identifier
The middle digits are assigned by the issuer to a specific account. Their length varies by issuer and product, which is why PANs legitimately range from 12 to 19 digits — a point many validators get wrong, as explained in why card numbers are 12 to 19 digits long.
3. Check digit
The final digit is computed from everything before it with the Luhn algorithm. It exists purely to catch typing errors.
Example: 4242 4242 4242 4242
- IIN: 424242 (a Visa sandbox range published by Stripe).
- Account identifier: 424242424.
- Check digit: 2.
The PAN is classified as cardholder data under PCI DSS. Never log it, store it unencrypted or display more than the first six and last four digits — see masking rules.

Keywords: PAN, primary account number, card number structure, IIN, account identifier, ISO/IEC 7812
Frequently asked questions
How many digits does a card number have?
Between 12 and 19. Visa and Mastercard typically use 16, American Express 15, Diners Club often 14.
What do the first 6 digits of a card mean?
They are the Issuer Identification Number (IIN), identifying the bank or institution that issued the card and often the product type.