Skip Nav

Luhn Formula For Credit Cards

What Do Tom Hanks and Your Credit Card Have in Common?

If you said an affinity for complicated mathematical equations, you’re right! Within every credit card number is a hidden, Da Vinci Code-esque formula that can tell you whether or not the card is valid. The code was developed pre-computer as a way to check for data entry errors or fraud, but it still works today. Want to try it out on your own plastic? Keep reading.

The formula, named the Luhn formula after its creator, goes like this:

  • Write out your credit card number on a sheet of paper.
  • Starting with the second number from the right, double every other number. Write the new results down under the original numbers, and cross out the old numbers.
  • If any numbers are double-digit, add the two digits together. Cross out the old numbers.
  • Add together all the un-crossed-out numbers.

The result should be a number that ends in zero, which indicates a valid card. If it’s not, time to get on the phone to your credit card company, pronto!

Latest Money & Career