MII: In the above example, 6 is MII or Major Industry Identifier. This one digit identifier tells us which industry the card belongs to. Following table lists MIIs and industries they represent:
|0||ISO/TC 68 and other industry assignments|
|2||Airlines, financial and other future industry assignments|
|3||Travel and entertainment|
|4||Banking and financial|
|5||Banking and financial|
|6||Merchandising and banking/financial|
|7||Petroleum and other future industry assignments|
|8||Healthcare, telecommunications and other future industry assignments|
|9||For assignment by national standards bodies|
IIN/BIN: Digits 1 to 6 make up IIN or Issuer Identification Number. This six digit number includes the first digit of MII. IIN tells you which bank has issued the card. It is sometimes also referred to as BIN (Bank Identifier Number). The website Binlists is an organized collection of BINs for credit cards as well as debit cards.
IAI: 7 to 15 digits represent Individual Account Identifier. This number is used to identify the customer account associated with the card.
Check Digit: The last digit is a check digit calculated by Luhn algorithm. In our example card number, check digit is 5.
Luhn test is at the heart of the question how credit card numbers work! Luhn test is the frontline defence against fraud. If you are a programmer, you may want to take a look at Rosettacode.org where this algorithm is implemented in 98 different programming languages.