Credit Card numbers are generated with something called the Luhn algorithm. It is a checksum algorithm. It takes the 15 real digits of your credit card and determines the 16th.
This means that only one final digit is valid, and 9 are invalid. If you type a number in wrong, it will definitely fail the checksum.
The algorithm also counts every second digit differently (they’re doubled). This means that simply swapping digits also causes a failure, which is the most common type of error when typing a card number.
There is some internal logic to the format the numbers should be in. So in many cases a typo of one digit would make the number invalid.
Old computer games could also do that offline where the CD key had to follow a certain format and rules.
Someone else can probably explain in detail how the check actually works.
I believe similarly to an American SSN, the first 4 numbers of the card are the bank that card is processed through. For example 4833 is Visa where I live. The second set is another specific set of numbers and I believe only the last 4 really specify YOUR card. Hence why when you go to online checkout you see your MasterCard and it only shows the last 4 numbers because that’s the only info you need to distinguish one out of many cards.
Latest Answers