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

342 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

This is a security constraint built into the numbers.

Credit card numbers are not just randomly generated. The numbers encode information such as the card issuer.

They also stick the first 15 numbers into an algorithm that spits out a single digit. That digit is the 16th number on your card.

A website can check these things. Does the 16th digit match the result of the algorithm applied to the first 15? Do the numbers that map to the issuer map correctly (does your discover card number start with a 6?).

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