How to Read a Credit Card Number: BIN, Luhn, Brand and Format
A credit card number looks like a random string of digits, but it is actually a structured code. Once you know how it is built, you can tell the brand, the issuing bank, and whether a number was typed correctly — all from the digits themselves. Here is how to read one.
The three parts of a card number
Every card number is made of three sections:
- IIN / BIN — the first 6 to 8 digits (the Issuer Identification Number, also called the Bank Identification Number). This identifies the scheme, the issuing bank and the country.
- Account number — the middle digits that identify your specific account within that bank.
- Check digit — the final single digit, a Luhn checksum over everything before it.
You can see all three at a glance with the Format tab of the Card Toolkit: paste a number and it shows the brand, the BIN, the digit count and the Luhn result.
How the brand is detected
The leading digits map to a scheme:
- 4 → Visa
- 51–55 and 2221–2720 → Mastercard
- 34, 37 → American Express
- 6011, 65, 644–649 → Discover
- 35 → JCB · 36/38/30 → Diners Club · 62 → UnionPay
To go beyond the brand and find the issuing bank and country, look up the BIN with the BIN Lookup.
The Luhn check digit
The last digit is calculated with the Luhn algorithm. Starting from the right, every second digit is doubled (and if the result is over 9, you subtract 9), then all digits are summed. A valid number makes that sum a multiple of 10. This single digit catches the most common data-entry mistakes — a mistyped digit or two digits swapped — instantly.
Remember: passing Luhn means the number is well-formed, not that the card is real or active. Verifying a number is what the Card Validator does.
Grouping and masking
Cards are displayed in groups for readability. The two common patterns are:
- 4-4-4-4 for 16-digit cards (Visa, Mastercard, Discover)
- 4-6-5 for 15-digit American Express cards
When you need to show a card reference safely — in a receipt, a support ticket or a screenshot — you mask all but the last four digits, e.g. •••• •••• •••• 1234. The Format tab of the Card Toolkit does both grouping and masking in one click.
Why this matters
Reading a card number correctly powers a lot of everyday payment work: detecting the brand to show the right logo, validating input before you send it to a gateway, flagging an unusual length, and storing only a masked reference. None of it requires contacting a bank — it is all in the structure of the number.
Try it
Open the Card Toolkit, paste any card number into the Format & Check tab, and watch it break down the brand, BIN, length and Luhn status live — or switch to Generate to create Luhn-valid dummy numbers for QA.