SecLern
Blog · Video lessons · 1 min

Your card number checks itself

Your card number checks itself

By The SecLern Team · Dec 1, 2026

Transcript

Your card number checks itself before the bank ever sees it. Type one digit wrong at checkout, and the box turns red instantly. That's because the last digit is a check digit: a tiny sum built into the number. The trick is called the Luhn check, from IBM engineer Hans Peter Luhn, patented in 1960. Let's run it on a test card. Start at the right. Keep the last digit, then double every second digit. If a double has two digits, add them. Five doubled is ten, so it counts as one. Now add everything. The total is 60. It ends in zero, so the number is valid. Now one typo: this four becomes a three. The total drops to 58. Rejected. It catches every single wrong digit, and almost every pair of swapped neighbours. But it isn't security. Anyone can build a number that passes. It only stops mistakes. Your phone's IMEI, its serial number, and your SIM card's number use the same check. So remember it like this: double every second digit from the right, add, and look for a zero. Want more tricks like this? Comment CHEAT and I'll send you the free cheat sheets from seclern.com. And follow for more.

The SecLern TeamSecLern builds practice questions, performance-based questions and browser-based hands-on labs for IT certifications.