Numbering

Credit cards are mostly of the same size,
as a standard has been developed for credit cards known as ISO 7810 standard.
Although different companies use their own numbering systems, ANSI Standard
X4.13-1983 is the most widely used system for credit card numberings.
The first digit in the number shows the network or credit system;
- If it is 3 then the card type is travel/entertainment (such as American Express and Diners Club)
- If it is 4 then the network system is Visa
- If the number is 4 then the network system is MasterCard
- If the number is 6 then the network system is Discover Card
Different systems have different structure of their credit card number. For example; American express starts with 37 whereas Diners club start with 38.
American Express
American express system has 15 digits for the credit card number. First four number shows, country code, currency code and card type i.e. charge or credit. Digit five to six tells whether the card is gold or platinum. Digit seven represents the billing cycle. Digits 8 to eleven give the account number. Digit 13 and 14 are used to represent the number of card holders. It begins at 00 and increments when card holders are added. Last or 15th digit is the check digit.
Visa
On visa card, digit 2 to 6 represents the bank number. Two schemes are followed after the first 6 digits. Either digit seven to 12 or 7 to 15 show the account number. Digit 13 or 16 in the longer version is the check digits.
Master Card
In master cards several combinations for bank numbers can be used. Digits two and three, or two up to four, or two up to five, or two up to six (depending upon the second digit, if it is 1, 2, 3 or other) can be used to represent the bank number. The digits after the bank number upto 15 are the account number. 16th digit is the check digit.
Purpose of check digit
The final digit is the check digit and it is used to validate a variety of account numbers. It prevents any casual attempts of creating numbers (only one in ten will be valid) but not any malicious attack. It also prevents mistakes made during manual recording of credit card numbers. The check sum test for numbers is done by Luhn formula, described in Annex B of ISO/IEC 7812, Part 1. This algorithm is also known as '"modulus 10"' algorithm and is in wide use today.