We had a fun little discussion via email at the day-job. Someone changed the code on the combination lock and the discussion around combinations, permutations, cryptography and all things sneaky-math cranked up.
It reminded me of this neat fact I learned about credit card security.
Not all digits on a credit card are created equally!
A credit card is made up of 16 numbers. But only the first 15 are “random,” according to NRich Math. The last number – the 16th number – is the “check digit.” It’s calculated using a fancy formula using the first 15 digits.
This check digit helps a computer system quickly determine if a credit card number is fake. Now, it can’t confirm that it’s real – it just can help determine if it is fake.
The digit is created using a method called Codabar.
First, let’s define some things.
An odd digit is a digit in the credit card number that is in an odd position. For the photo of the card here, the number is: 5184 8204 5526 6423:

The odd digits are 5, 8, 8, 0, 5, 2, 6, 2
An even digit is a digit in the credit card number that is in an even position. For the photo of the card here, even digits are 1, 4, 2, 4, 5, 6, 4, 3
The check digit is the last digit – it gets calculated and isn’t considered in either odd or even position. It’s a super special digit.
The method is weird – and kinda fun!
Here’s what you do:
- Add up all the odd digits, or the digits in the odd positions: 5 + 8 + 8 + 0 + 5 + 2 + 6 + 2 = 36
- Double that number: 36 × 2 = 72. Save this number, 72, for later…
- Add the even digits together, or the digits in the even positions: 1 + 4 + 2 + 4 + 5 + 6 + 4 + 3 = 29. Save this number, 29, for later…
- (This is a freaky step.) Count the number of odd digits that are greater than 4. The odd digits are 5, 8, 8, 0, 5, 2, 6, 2. Of these, 5, 8, 8, 5 and 6 are bigger than 4. There are 5 of those total. Save this number, 5, for this next step…
- Add up the results you saved from steps #2, #3 and #4. 72 + 29 + 5 = 106
- Take the answer from step #5 and figure out how many you need to add to get it to the next multiple of 10 (or the next number that ends in zero). The number after 106 that ends in zero is 110. So we need to add 4. 106 + 4 = 110. 4 is the super important number.
- That final super important number – well, that’s the check digit! That’s the last number that should be on the credit card – if it were a real card!
For the picture, the check digit should be a 4. And it’s a 3. So I can tell instantly that this is a fake credit card number.
You can use this to teach your children!
Stuck in a waiting room with a 10-year-old? All you need is a pen, piece of paper and any credit card in your wallet.
Teach them the method and have them check all of your credit cards. Or tell them you can guess the last digit of any credit card number.
Either way, you’ve got an instant source of entertainment wrapped in a ball of education!
What do you think? Are you racing to your purse right now to check your cards? Share your thoughts in the comments.


