# Luhn Algorithm: Uses in Identity Verification for Credit Cards

![Two female developers figuring out an algorithm](https://www.investopedia.com/thmb/eY9Bn_DI6ZB4LqtHnutPsKDuyp4=/1500x0/filters:no_upscale():max_bytes(150000):strip_icc()/LuhnAlgorithmUsesinIdentityVerificationforCreditCards-866c0281903840f89d62f1cc3513742b.jpg)

*— BalanceFormcreative / Getty Images*

## 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](https://www.investopedia.com/terms/c/creditcard.asp) numbers, as well as other number sequences such as government [Social Security numbers (SSNs)](https://www.investopedia.com/terms/s/ssn.asp).

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

### Key Takeaways

*   The Luhn algorithm is a mathematical formula developed in the late 1950s.
*   The Luhn algorithm is widely used to validate the authenticity of identification numbers, such as Social Security numbers.
*   In finance, the Luhn algorithm facilitates electronic payments by rapidly identifying mis-entered credit card numbers.
*   Whether buying something online or at a store's point of sale (POS) terminal, the Luhn algorithm identifies the card number within the payment processing system.

## How the Luhn Algorithm Works

The Luhn algorithm is widely used to validate the authenticity of identification numbers, such as Social Security and credit card numbers.

### History of the Luhn Algorithm

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](https://www.investopedia.com/terms/a/algorithm.asp) 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.

### Luhn Algorithm Process

The Luhn algorithm applies 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 matches, the credit number is deemed valid. If it's an incorrect match, the algorithm will reject the credit card number, indicating the user made an error when inputting the number.

### How the Luhn Algorithm Is Used

From a customer’s perspective, we frequently use the Luhn algorithm when placing orders online or using a merchant’s [point of sale (POS) terminal](https://www.investopedia.com/terms/p/point-of-sale.asp). The computer system can quickly tell when we have input the incorrect credit card information since 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 the transaction was approved. In other words, the Luhn algorithm helps us quickly identify user errors, thereby speeding up the pace of transactions.

## Real-World Examples 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 automatically determined by the Luhn algorithm based on the preceding numbers in the sequence. When users enter their credit card numbers to complete a payment, the credit card 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.

> **Tip**
>
> Be sure to monitor your credit and request copies of your credit reports to determine if there are any errors or unauthorized activity, such as a new credit card opened without your permission. You can obtain a free credit report every year from each of the three credit reporting companies by visiting AnnualCreditReport.com.

## What Is the Luhn Algorithm Used for?

The Luhn algorithm is used to check or validate identification numbers to ensure their accuracy. Today, the [algorithm](https://www.investopedia.com/terms/a/algorithmictrading.asp) verifies that a credit card or Social Security number was input and processed accurately.

## What Is a MOD 10 Error?

The MOD 10 error or Modulus 10 error occurs when a user inputs an inaccurate identification or credit card number. The MOD 10 algorithm—also called the Luhn algorithm—uses a mathematical formula to validate the number input by a user, and if it's inaccurate, a MOD 10 error will result.

## Can Credit Card Companies Check Your Credit Without Permission?

If you apply for a [credit card](https://www.investopedia.com/personal-finance/top-credit-cards-international-students/) with the company, the credit card company can pull and view your credit report—called a [hard inquiry](https://www.investopedia.com/terms/h/hard-inquiry.asp). If you're an existing customer with a credit card company, they can pull your credit report at any time to manage your account–called a [soft inquiry](https://www.investopedia.com/terms/s/soft-inquiry.asp). However, credit card companies cannot [pull your credit report](https://www.investopedia.com/terms/c/credit-inquiry.asp) if you are not their customer or haven't applied for credit with them.

## The Bottom Line

The Luhn algorithm is a formula used to determine whether a user's identification number is accurate. Examples of use cases for the Luhn [algorithm](https://www.investopedia.com/articles/markets/012716/four-big-risks-algorithmic-highfrequency-trading.asp) include validating credit card Social Security numbers (SSNs).

> **Article Sources**
>
> 1.  United States Patent and Trademark Office. "[Computer for Verifying Numbers, U.S. Patents No. 2,950,048, Filed Jan. 6, 1954](https://ppubs.uspto.gov/dirsearch-public/print/downloadBasicPdf/2950048?requestToken=eyJzdWIiOiI2YmJiMjZlMS0xODQ4LTQ1N2UtOGYwNC01MDNlMWJjMGEzYzEiLCJ2ZXIiOiJhZTQ2ZmQ1MS01YmU2LTQ3MzUtOGZiZC1jNTMzZjk0MjQ5ZjIiLCJleHAiOjB9)." Pages 1-7.
>     
> 2.  Gocardless.com. "[What is the Luhn Algorithm?](https://gocardless.com/en-us/guides/posts/what-is-luhn-algorithm/)"
>     
> 3.  Cornell Law School. "[Algorithm](https://www.law.cornell.edu/wex/algorithm)."
>     
> 4.  Consumer Financial Protection Bureau. "[Protect Yourself from Credit Card Fraud at the Register](https://www.consumerfinance.gov/about-us/blog/protect-yourself-credit-card-fraud-register/)."
>     
> 5.  Consumer Financial Protection Bureau. "[When Can a Credit Card Company Look at My Credit Reports?](https://www.consumerfinance.gov/ask-cfpb/when-can-a-credit-card-company-look-at-my-credit-reports-en-3/)"