Credit card numbers follow ANSI Standard X4.13-1983, and are created by using the Luhn algorithm. A valid credit card satisfies the Luhn check, which uses simple mathematical formula to validate a checksum of all numbers.
Credit Card Numbers
1. MII Number - The First Digit
The major credit card numbers are comprised of 15 or 16-digit numbers, of which the first digit represents the Major Industry Identifier (MII). The last digit is the checksum digit that confirms to the Luhn algorithm (see below). Most popular MII identifiers are:
Starts with 34 or 37
Starts with 36 or 38
Starts with 65, 644, 6011
Starts with 50, 56, 58, 63, 67
2. IIN/BIN Number - The First 6-digits
The first 6-digit numbers including the MII is known as the Issuer Identification Number (IIN), formally known as the Bank Identification Number (BIN). The IIN tells us which credit card company issued the card, and what network it belongs to. For example, the credit card number starting with the 414720 represents JP Morgan Chase cards.
3. Account Number - The Next Digits before Final Digit
The next several digits before the final digit is known as the individual's account number.
4. Checksum - The Last Digit
The last digit is made up from the Luhn algorithm, and it represents the checksum of all digits. A card complying to Luhn check is the valid credit card number whethere it is actually issued by a card issuer or not.
Luhn algorithm is the modulus 10 formula used to validate a variety of identification numbers such as credit card and IMEI numbers.
The right-most digit is used as the checksum digit, and the rest of the numbers represent the payload. Based on the position of
the each digit, every 2nd digit from the right-most payload are doubled, and each digit (or doubled) are summed up make up the total. The total is then modulated to create the checksum digit. The payload and the checksum digit make up the credit card number.
To learn more about Luhn Algorithm, please refer Wikipedia page.
Test Credit Card Numbers
As a developer, you may need an access to the "test" credit card numbers from various brands. We are listing a commonly used credit
card numbers from well known brands that you can utilize. The numbers below conforms to Luhn check, and are valid card numbers.