Luhn Algorithm - Definition from TechTarget (2024)

What is the Luhn algorithm?

The Luhn algorithm, also called modulus 10 or modulus 10 algorithm, is a simple mathematical formula used to validate a user's identification numbers. Originally created by a group of mathematicians and inventor Hans Peter Luhn in the 1960s, the Luhn algorithm is used by most major credit card companies to verify that the cardholder's number is valid. It is also used to validate number sequences for government identification numbers, Social Security numbers, Social Insurance numbers in Canada and International Mobile Equipment Identity (IMEI) numbers. The algorithm, which is in the public domain and can be used by anyone, was designed to detect incorrect values and single-digit errors that may have been introduced by mistyping but not specific malicious attacks.

The mathematical formula used is called a checksum, which is a value that represents the number of bits in a transmission message. Similar to how a checksum is used in Luhn's algorithm, checksums are commonly used by IT professionals to detect high-level errors within data transmissions.

How does the Luhn algorithm work?

The Luhn formula applies some basic arithmetic to an identification number to calculate a value that must agree with the check digit -- which, for example, is the last number that appears on the credit card. Here are the formula's four steps:

  1. Beginning on the top line at the second digit from the end, going from right to left, multiply every other number on the "Digit" line by two.
  2. Again, proceeding right to left, take each of the digits skipped in step 1 and multiply it by 1.
  3. Next, add the numbers from steps 1 and 2 together on the "Product" line. If doubling a number in step 1 results in a two-digit number, such as 5 x 2 = 10, use the sum of each of these digits -- 1 + 0 = 1 -- when adding the sum of the products.
  4. If the sum of the numbers added up ends in 0, then the number is valid. If not, it is invalid.
Luhn Algorithm - Definition from TechTarget (2)

Real-world examples of the Luhn algorithm

Businesses can use the Luhn formula to ensure a credit card number is valid before sending it for authorization. Credit card companies, including American Express, Visa, Mastercard and Discover, use the Luhn algorithm. It does not verify any other information on a credit card, including whether the card's date is valid.

The IMEI number is used to identify hardware type for a mobile phone. Every mobile phone has a unique 15- to 17-digit code, and the leftmost digits contain information about the phone type. An IMEI code can also be used to prevent a misplaced or stolen phone from being used to make calls, as well as help someone who buys a used phone determine if the phone is valid.

The Luhn formula can also be used with gift cards, where a gift card code is generated with a random number and a checksum is associated with it. The gift card code is stored in a database with its associated data. The Luhn algorithm ensures the gift code, if written by a person, is valid and without mistakes.

Aside from validating credit card numbers and gift cards, other instances of the use of the Luhn algorithm include the following:

  • SIM card numbers
  • survey codes
  • point-of-sale systems
  • South African ID numbers
  • Swedish national identification numbers
  • programming languages and code libraries

There are several digital authentication methods used today, including passwords and two-factor authentication. Learn what other forms of authentication are used to verify electronic authenticity.

This was last updated in April 2022

Continue Reading About Luhn algorithm (modulus 10)

  • Researchers hack Apple Pay, Visa 'Express Transit' mode
  • Startups launch verification technology to help manage networks
  • Codecov breach raises concerns about software supply chain
  • The importance of AI for fraud prevention
  • How do cybercriminals steal credit card information?

Related Terms

personally identifiable information (PII)
Personally identifiable information (PII) is any data that could potentially identify a specific individual.Seecompletedefinition
What is GDPR? Compliance and conditions explained
The General Data Protection Regulation (GDPR) is legislation that updated and unified data privacy laws across the European Union...Seecompletedefinition
What is the Cybersecurity Information Sharing Act (CISA)?
The Cybersecurity Information Sharing Act (CISA) allows United States government agencies and non-government entities to share ...Seecompletedefinition

Dig Deeper on Compliance

  • Fibonacci sequence use cases in technologyBy: SabrinaPolin
  • How to calculate a subnet mask from hosts and subnetsBy: TerrySlattery
  • What is clustering in machine learning and how does it work?By: PatrickHall
  • What is Bayes' theorem? How is it used in machine learning?By: OliviaWisbey
Luhn Algorithm - Definition from TechTarget (2024)
Top Articles
Choose the word that is opposite in meaning to the given word.REJECTAgreeAcceptAdoptEmbrace
8 Foods That Help Acid Reflux and Heartburn
Fiskars X27 Kloofbijl - 92 cm | bol
Www.mytotalrewards/Rtx
Jennifer Hart Facebook
1970 Chevelle Ss For Sale Craigslist
My Boyfriend Has No Money And I Pay For Everything
Us 25 Yard Sale Map
5 Bijwerkingen van zwemmen in een zwembad met te veel chloor - Bereik uw gezondheidsdoelen met praktische hulpmiddelen voor eten en fitness, deskundige bronnen en een betrokken gemeenschap.
Aiken County government, school officials promote penny tax in North Augusta
Mivf Mdcalc
Oppenheimer & Co. Inc. Buys Shares of 798,472 AST SpaceMobile, Inc. (NASDAQ:ASTS)
Lesson 1 Homework 5.5 Answer Key
Daniela Antury Telegram
Wisconsin Women's Volleyball Team Leaked Pictures
Pac Man Deviantart
Mail.zsthost Change Password
Telegram Scat
Ou Class Nav
Kountry Pumpkin 29
Azpeople View Paycheck/W2
Project, Time & Expense Tracking Software for Business
O'Reilly Auto Parts - Mathis, TX - Nextdoor
Providence Medical Group-West Hills Primary Care
Yonkers Results For Tonight
Sienna
What Equals 16
Gma' Deals & Steals Today
Vht Shortener
A Man Called Otto Showtimes Near Carolina Mall Cinema
WOODSTOCK CELEBRATES 50 YEARS WITH COMPREHENSIVE 38-CD DELUXE BOXED SET | Rhino
O'reilly's Wrens Georgia
Tmj4 Weather Milwaukee
Kattis-Solutions
The Ride | Rotten Tomatoes
Foolproof Module 6 Test Answers
Hannibal Mo Craigslist Pets
The Vélodrome d'Hiver (Vél d'Hiv) Roundup
Studentvue Columbia Heights
Academic important dates - University of Victoria
Uvalde Topic
Saline Inmate Roster
M&T Bank
Sinai Sdn 2023
Windy Bee Favor
Blippi Park Carlsbad
Jeep Forum Cj
Definition of WMT
Buildapc Deals
Nkey rollover - Hitta bästa priset på Prisjakt
Qvc Com Blogs
Latest Posts
Article information

Author: Greg O'Connell

Last Updated:

Views: 6613

Rating: 4.1 / 5 (62 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Greg O'Connell

Birthday: 1992-01-10

Address: Suite 517 2436 Jefferey Pass, Shanitaside, UT 27519

Phone: +2614651609714

Job: Education Developer

Hobby: Cooking, Gambling, Pottery, Shooting, Baseball, Singing, Snowboarding

Introduction: My name is Greg O'Connell, I am a delightful, colorful, talented, kind, lively, modern, tender person who loves writing and wants to share my knowledge and understanding with you.