# eli5 how do EFTPOS machines instantly know a card number is invalid? for instance if there are 16 card numbers and I put in the 10th digit in wrong, machine beeps and does not let me put that digit it in, surely there are cards with one number difference

182 views

eli5 how do EFTPOS machines instantly know a card number is invalid? for instance if there are 16 card numbers and I put in the 10th digit in wrong, machine beeps and does not let me put that digit it in, surely there are cards with one number difference

In: 8

Card numbers are usually generated using a mathematical algorithm. For instance, I believe credit card numbers are often generated using [modular arithmetic](https://en.wikipedia.org/wiki/Modular_arithmetic) algorithms. Because the card number is the result of a specific set of mathematical steps the computer can instantly determine if a card number is valid or not. For example, due to the steps of the algorithm, it may not be possible for the 10th digit to be a 7 so when you try to enter a 7 as the 10th digit the computer automatically knows it’s the wrong number.

The last digit of the card number is a checksum digit: for a given combination of 15 digits, there’s only one possible value for the final digit.

If that value doesn’t match up, the card number clearly was entered incorrectly