Luhn Algorithm

Luhn Algorithm

The Luhn Algorithm — also known as the “Modulus 10 Algorithm” — is a formula that is used to determine whether the identification number provided by a user is accurate. The formula is widely used in validating credit card numbers, as well as other number sequences such as government Social Security Numbers (SSNs). Today, the Luhn Algorithm is an essential component in the electronics payments system and is used by all major credit cards. The Luhn Algorithm — also known as the “Modulus 10 Algorithm” — is a formula that is used to determine whether the identification number provided by a user is accurate. The formula is widely used in validating credit card numbers, as well as other number sequences such as government Social Security Numbers (SSNs). Today, the Luhn Algorithm is an essential component in the electronics payments system and is used by all major credit cards. When users enter their credit card numbers to complete transactions, the payment processing software can use the Luhn Algorithm to detect whether the specified number is accurate, based in part on its check digit. Today, the Luhn Algorithm is integrated into popular programming languages and code libraries, making it relatively easy to include Luhn-based identification number verification in new software applications. Rather than being specifically chosen by the credit card company, the check digit is instead automatically determined by the Luhn Algorithm, based on the preceding numbers in the sequence.

The Luhn Algorithm is a mathematical formula developed in the late 1950s.

What Is the Luhn Algorithm?

The Luhn Algorithm — also known as the “Modulus 10 Algorithm” — is a formula that is used to determine whether the identification number provided by a user is accurate. The formula is widely used in validating credit card numbers, as well as other number sequences such as government Social Security Numbers (SSNs).

Today, the Luhn Algorithm is an essential component in the electronics payments system and is used by all major credit cards.

The Luhn Algorithm is a mathematical formula developed in the late 1950s.
It is widely used to validate the authenticity of identification numbers.
In finance, it has helped increase electronic payments processing by rapidly identifying mis-entered credit card numbers.

How the Luhn Algorithm Works

The LUHN formula algorithm was developed by a German Computer Scientist named Hans Peter Luhn in 1954 while working as a researcher at IBM. The exact workings of the algorithm are based on modular arithmetic, a mathematical technique developed by Carl Friedrich Gauss in the early 19th century. Although its detailed workings are rather complex, it is best known for allowing computers to quickly assess whether the credit card numbers provided by customers are accurate.

The way it does so is by applying a series of computations to the credit card number given, adding up the results of those computations, and checking whether the resulting number matches the expected result. If it does, then the credit number is deemed valid. If not, the algorithm will reject the credit card number, indicating that the user made an error when inputting the number.

From a customer’s perspective, we use the Luhn Algorithm all the time, without even realizing it. When placing orders online or using a merchant’s point of sale (POS) terminal, computer systems are able to quickly tell when we have made a mistake inputting our information. This is because the Luhn Algorithm has been incorporated into those systems’ programming. Without it, we would need to wait until the entire purchase order is submitted before realizing whether the transaction was approved. The Luhn Algorithm, in other words, helps us quickly identify user errors and thereby speed up the pace of transactions.

Real-World Example of the Luhn Algorithm

One of the central concepts within the Luhn Algorithm is the use of so-called “check digits.” These digits consist of numbers that are inserted into the broader number sequence in order to help verify, or “check,” whether the whole number is authentic.

For credit cards, the check digit consists of a single digit printed at the end of the credit card number. Rather than being specifically chosen by the credit card company, the check digit is instead automatically determined by the Luhn Algorithm, based on the preceding numbers in the sequence. When users enter their credit card numbers to complete transactions, the payment processing software can use the Luhn Algorithm to detect whether the specified number is accurate, based in part on its check digit.

Today, the Luhn Algorithm is integrated into popular programming languages and code libraries, making it relatively easy to include Luhn-based identification number verification in new software applications.

Related terms:

Algorithm

Algorithms are sets of rules for solving problems or accomplishing tasks. read more

Bank Identification Number (BIN)

A bank identification number (BIN) is the initial set of four to six numbers on a credit card that identifies the institution. read more

Blockchain : What You Need to Know

A guide to help you understand what blockchain is and how it can be used by industries. You've probably encountered a definition like this: “blockchain is a distributed, decentralized, public ledger." But blockchain is easier to understand than it sounds. read more

Credit Card

Issued by a financial company giving the holder an option to borrow funds, credit cards charge interest and are primarily used for short-term financing.  read more

Hash

A hash is a function that converts an input of letters and numbers into an encrypted output of a fixed length. read more

Hyperledger Iroha

Hyperledger Iroha is a business blockchain framework designed for infrastructure projects that need distributed ledger technology. read more

Point of Sale (POS)

Point of sale (POS) refers to the place where customers execute payments for goods or services. POS systems provide companies with sales and marketing data. read more

Private Label Store Credit Card Defined

A private label credit card is a store-branded credit card that is intended for use at a specific store. It offers credit and sometimes special benefits at those stores. read more

Social Security Number (SSN)

A Social Security number (SSN) is a numerical identifier assigned to U.S. citizens and some residents to track their income and determine benefits. read more

Zero Liability Policy

A zero liability policy absolves a credit or debit cardholder from responsibility for fraudulent charges, but be sure to read the fine print. read more