The LUHN formula, also called modulus 10, is a simple algorithm used to validate the number on a credit card. It works on cards issued by all the major credit card companies, including American Express, Visa, Master Card, Discover, and Diner's Club. Originally created by a group of mathematicians in the 1960s, the LUHN formula is in the public domain, and anyone can use it.
By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
The LUHN formula applies some simple arithemetic to a credit card number to calculate a number that must agree with the check digit, the last number that appears on the credit card. Here are the formula's three steps:
1. Beginning with the second digit from the end (on the right), take every other digit and multiply it by two.
2. Proceeding right to left, take each of the digits skipped in step 1 and add them to the result digits from step 1. If the result of doubling a number in step 1 resulted in a two-digit number (such as 7 + 7 = 14), use each of these digits (1 and 4) in adding the digits in step 2.
3. Subtract the result obtained in step 2 from the next higher number that ends in 0. The result must agree with the check digit.
The LUHN formula can be used by a business to make sure a credit card is valid before sending the number for debit authorization. In Canada, it is used to validate a person's Social Insurance Number. It does not verify any other information on a credit card, including whether the card's date is valid.