Photo: Andres Rueda

You most likely use credit cards daily, but have you taken the time to consider how they work? Let’s examine one of the most obvious aspects of the credit card: the number. Credit card numbers are 14 to 16 digits long and link your purchase back to your account at the bank. But what do they mean?

The first digit is reserved for specifying what type of card it is. 3 = Travel and Entertainment card (34/37 = AMEX, 38 = Diner’s Club), 4 = Visa, 5 = MasterCard, and 6 = Discover. Each type handles the next 12 to 14 digits differently. They are used to identify the account number, bank number, whether it is a business or personal account, and/or the currency. Check out these sites for a more in depth coverage of how each credit card provider uses these digits.

One thing all credit cards have in common is a check digit at the end which is used to verify that it is a valid credit card. The check digit uses the Luhn algorithm, also known as the modulus 10 algorithm, to “check” the rest of the numbers. It’s goal is to not prevent counterfeit, but rather to protect against the accidental mistyping or mistransmission of the number.

The algorithm:

- Double the value of every second digit moving from right to left.
- Sum the value of every individual digit.
- If the total ends in zero it is valid, any other number it is invalid.

Let’s take a simple example: 47142

- 2×4 = 8, 2×7 = 14. Therefore we have 4(14)1(8)2
- 4+1+4+1+8+2 = 20
- 20 ends in zero so the number is valid.