Have you ever wondered how credit card companies come up with those numbers on your card? I always assumed that it was randomly generated. Some people thinks that it depends on your location, bank or the day you get your credit card. Turns out that all credit card companies follow the same rules in generating credit card numbers. There's even a way to know if a credit card is fake or not.
The first digit is the Major Industry Identifier(MII). Its the category of the entity which issued the card.
1 and 2 : Airlines
3: Travel and Entertainment
4 and 5 Banking and Financial
6: Merchandising and Banking
7: Petroleum
8: Telecommunication
9: National assignment
The first 6 digits including the MII is the Issuer Identification Number(INN). It will identify the institution that issued the card.
VISA: 4xxx-xx
MASTERCARD: 51xx-xx to 55xx-xx
DISCOVER: 6011-xx ; 644x-xx ; 65xx-xx
AMEX: 34xx-xx ; 37xx-xx
The next digits excluding the last digit are the account holder's number.
The last number is the check digit or checksum. It is used to validate a credit card using Luhn algorithm or "modulus 10". It was created by IBM scientist Hans Peter Luhn. basically you just need to check if your credit card numbers, after doing some math will be divisible by 10. If its not, then its fake or invalid. You should try this with your credit card. Here how it works:
Multiply by 2 every other number starting from the second digit, from right to left. Then add all of these numbers including the one's you haven't multiplied. If the sum is divisible by 10 then the credit card is valid.
Source: mint.com/blog ; gizmodo.com