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.

Issuer, account, check digit — three fields in one number.
Issuer, account, check digit — three fields in one number. — © Dom J · Pexels

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.
Different brands, same underlying structure.
Different brands, same underlying structure.

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.

On this site

External references

Related articles

تشريح رقم البطاقة (PAN): المُصدِر والحساب وخانة التحقق — النسخة العربية

الخانات الست عشرة على البطاقة ثلاثة حقول متنكّرة. فهمها يفسّر لماذا تكتشف النماذج فيزا بعد أربع ضغطات، ولماذا تتراوح الأطوال بين 12 و19.

PAN اختصار لـPrimary Account Number — الرقم الطويل المنقوش أو المطبوع على بطاقة الدفع. ورغم أنه يُقرأ كسلسلة واحدة، يعرّفه معيار ISO/IEC 7812 بثلاثة حقول متمايزة. اكتب أي رقم في قسم النطاقات وسيلوّن الموقع كل حقل لك.

1. معرّف المُصدِر (IIN)

أول ست خانات (وقد امتدت الآن إلى ثمانٍ) تحدّد المؤسسة المُصدِرة وغالبًا المنتج — خصم أو ائتمان أو مسبقة الدفع أو تجارية. تحجز الشبكات خانات أولى: 4 لفيزا، و51–55 و2221–2720 لماستركارد، و34/37 لأمريكان إكسبريس. ولهذا يستطيع النموذج إظهار الشعار الصحيح بعد بضع خانات؛ ورقتنا المرجعية لبادئات الشبكات تسردها كلها. الاسم الأقدم لهذا الحقل هو BIN — انظر IIN مقابل BIN.

2. معرّف الحساب الفردي

الخانات الوسطى يخصّصها المُصدِر لحساب بعينه. يتفاوت طولها بحسب المُصدِر والمنتج، ولهذا تتراوح أرقام البطاقات شرعيًا بين 12 و19 خانة — وهي نقطة يخطئ فيها كثير من المدقّقين كما في لماذا تتراوح أرقام البطاقات بين 12 و19 خانة.

3. خانة التحقق

الخانة الأخيرة تُحسب من كل ما قبلها بـخوارزمية لون. توجد فقط لاكتشاف أخطاء الكتابة.

مثال: 4242 4242 4242 4242

  • IIN: ‏424242 (نطاق اختبار فيزا منشور لدى Stripe).
  • معرّف الحساب: 424242424.
  • خانة التحقق: 2.
يُصنَّف رقم البطاقة بيانات حامل البطاقة وفق PCI DSS. لا تسجّله في اللوغ ولا تخزّنه دون تشفير ولا تعرض أكثر من أول ست وآخر أربع خانات — انظر قواعد الإخفاء.

أسئلة شائعة

كم خانة في رقم البطاقة؟

بين 12 و19. فيزا وماستركارد عادة 16، وأمريكان إكسبريس 15، وداينرز كلوب غالبًا 14.

ماذا تعني أول 6 خانات من البطاقة؟

هي معرّف المُصدِر (IIN) الذي يحدّد البنك أو المؤسسة التي أصدرت البطاقة وغالبًا نوع المنتج.

Educational content — not legal or financial advice. Open the interactive Check Digit Lab →