cancel
Showing results for 
Search instead for 
Did you mean: 

Credit card numbers

Community Veteran
Posts: 7,908
Thanks: 588
Fixes: 8
Registered: 02-08-2007

Credit card numbers

Always assumed credit card numbers were randomly generated, seems this is not the case ?
You may have heard before that credit card numbers follow a certain pattern and structure so that they can be validated before a transaction is accepted. However, it's one thing to know that the structure is there and another thing entirely to understand how credit card numbers work.
Why would this knowledge be useful? Well, if you run a small business that doesn't process credit card payments immediately, you could save yourself money by ensuring the card details are valid. If you don't, well it could still be fun to show off your skills at parties. Here's how you do it.
Learning Where The Numbers Come From
Credit card numbers are not random. There's a special set of numbers to show information about the card issuer and another set to show information about the card holder. One other number is also important, but we'll come to that later.
The very first number is the Major Industry Identifier (MII) and it tells you what sort of institution issued the card.
    1 and 2 are issued by airlines.
    3 is issued by travel and entertainment.
    4 and 5 are issued by banking and financial institutions.
    6 is issued by merchandising and banking.
    7 is issued by petroleum companies.
    8 is issued by telecommunications companies.
    9 is issued by national assignment.
The first six digits are the Issuer Identification Number (IIN). These can be used to look up where the card originated from. If you have access to a list that details who owns each IIN, such as this list of popular IINs on Wikipedia, you can see who issued the card just by reading the card number.
Here's a few you might recognise:
    Visa: 4*****
    American Express (AMEX): 34**** or 37****
    Diner's Club International: 36****
    Mastercard: 51**** to 55****
The seventh digit to the second-to-last digit is the customer account number. Most companies use just 9 digits for the account numbers, but it's possible to use up to 12. This means that using the current algorithm for credit cards, the world can issue about a trillion cards before needing to change the system.
understand credit card numbers
We often see 16-digit credit card numbers today, but it's possible for a card issuer to issue a card with up to 19 digits using the current system. In the future, we may see longer numbers becoming more common.
The very last digit of each credit card is the check digit, or checksum. It is used to validate the credit card number using the Luhn algorithm, which we will now explain in detail.
The Luhn Algorithm Validation Check
The Luhn Algorithm is used to validate all sorts of numbers, including credit cards, IMEI numbers and some social security numbers. It's not designed to be a cryptographically secure hash function, but merely a way to check errors are not made when recording numbers. It is not foolproof, but is generally considered to be useful.
Take the credit card number and read the digits from the right. Double every other number and write them down - if you do it in the same order as your card is written it will help with clarity. Now, wherever you have calculated a double-digit number, change it so that it reads as "first digit + second digit" (in other words, sum the digits of the products). Finally, take your calculations and add those numbers to the numbers remaining on your card that you didn't double. A legitimate credit card number will give you a result that is divisible by 10.


2 REPLIES
Community Veteran
Posts: 16,823
Thanks: 1,112
Fixes: 13
Registered: 06-11-2007

Re: Credit card numbers

Very Interesting......
I am sure that some people in Romania will use this information wisely !  Cheesy
Moderator
Moderator
Posts: 16,525
Thanks: 1,780
Fixes: 123
Registered: 06-04-2007

Re: Credit card numbers

I've often wondered when I've accidentally entered the wrong card details a website throws an error even before it's contacted the issuing bank.
Interesting stuff.

Forum Moderator and Customer
Courage is resistance to fear, mastery of fear, not absence of fear - Mark Twain
He who feared he would not succeed sat still