Do you ever wonder if it would be possible for someone to create a counterfeit credit card, by making up a credit card number and producing a fake credit card with the number encoded in the magnetic stripe?
Well, not surprisingly, in the same way as bills and coins have numerous built-in defenses against fraudsters creating counterfeit currency, so do credit cards. The credit card expiration date and the three or four-digit security code on the card both serve as important verifications of the authenticity of the card. However, tthere is another important safety mechanism built into credit card numbers themselves, which most cardholders are not aware of. In fact, credit cards’ first line of defense against fraud was developed before computers—and is still used today by every credit, debit, and ATM card in the world.
All credit card numbers are created using a simple, mathematical formula to verify the authenticity of the number. Proposed in 1954 by German-born scientist Hans Peter Luhn, the elegant formula (dubbed the “Luhn formula”) was originally used to hand-check the accuracy of data entry. Now, with today’s technology, computers can check the Luhn formula faster than the blink of an eye—and weed out fake credit card numbers before they are ever sent to an issuer for verification.
Every card issued, whether a 16-digit Mastercard, Visa or Discover card, 15-digit American Express card, or 14-digit Diner’s Club/Carte Blanche card, uses this formula in its digits.
The way the Luhn formula works is simple, although it takes a few calculations. To find your credit card’s Luhn number, follow the steps below:
- Write out your credit card number.
- Starting with the second to last digit, double every other number. Write each new number down beneath the old, and cross out the old number.
- For any double-digit numbers produced by step two, add together the digits to create a single digit number. Jot that single digit number down beneath the double-digit one, and cross out the old double-digit number.
- Add all non-crossed out numbers together.
- The total should be a number divisible by 10.
Any time a card-processing system runs this formula and receives a number not divisible by 10, it immediately knows the card is either a fake or the information was mistyped.
The Luhn formula isn’t the only code in play on your credit card. For 16-digit Visa, MasterCard and Discover credit cards, the first six digits represent the card issuer, while the next nine are the actual account number; the 15-digit American Express cards use eight-digit numbers to identify card accounts. In addition, the last number of the card also plays a key role in card identification and validation.
The Luhn formula, which was originally used in a hand-held mechanical reader, has played a role not only in today’s credit card numbers, but also in the development of the world wide web, Google and other such search engines, text messaging, and more. As most mathematicians would agree, the Luhn formula is just one example of how modern day man benefits from mathematics in all aspects of life, without ever realizing it.









This always makes for a good article. I would add a number 6 to your example and point out the result of the division is the check digit, which is usually made the last digit of the card number.
Also, a correction, the first 9 digits of Visa and MasterCard’s represent the issuer: The first 6 are assigned the institution, and digits 7-9 can be used as sub-ranges within the issuer’s range.