Eli5: How do they know if it is a valid card number?

336 views

When you are asked to input your card information online, how is it that some websites can automatically know if you input an invalid number and others cannot, before payment is processed?Example: as soon as I typed the last number of my card wrong, it went red and would not allow me to continue before I corrected it.

In: 340

8 Answers

Anonymous 0 Comments

Every card number is issued following a mathematical formula called “Luhn algorithm”.

From each card number a checksum can be calculated by adding some together, multiplying others withing a set of rules.

This is easy for a computer and even a browser can do it instantly.

This prevents just putting in a random number by hand.

You are viewing 1 out of 8 answers, click here to view all answers.