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
S. Korea introduces 2 numbers in 1 phone service with eSIM
What Is an FX Forward Curve?
Www.1Tamilmv.cafe
Meer klaarheid bij toewijzing rechter
Myunlb
shopping.drugsourceinc.com/imperial | Imperial Health TX AZ
Unit 1 Lesson 5 Practice Problems Answer Key
Cvs Learnet Modules
No Strings Attached 123Movies
Insidekp.kp.org Hrconnect
Darksteel Plate Deepwoken
Walmart Windshield Wiper Blades
Saberhealth Time Track
Idaho Harvest Statistics
Eva Mastromatteo Erie Pa
Dirt Removal in Burnet, TX ~ Instant Upfront Pricing
Honda cb750 cbx z1 Kawasaki kz900 h2 kz 900 Harley Davidson BMW Indian - wanted - by dealer - sale - craigslist
360 Tabc Answers
Iu Spring Break 2024
Bella Bodhi [Model] - Bio, Height, Body Stats, Family, Career and Net Worth 
Certain Red Dye Nyt Crossword
Walgreens Bunce Rd
Dei Ebill
100 Gorgeous Princess Names: With Inspiring Meanings
The Goonies Showtimes Near Marcus Rosemount Cinema
Dailymotion
Emiri's Adventures
Siskiyou Co Craigslist
Average weekly earnings in Great Britain
Song That Goes Yeah Yeah Yeah Yeah Sounds Like Mgmt
Mp4Mania.net1
SF bay area cars & trucks "chevrolet 50" - craigslist
Td Ameritrade Learning Center
Yogu Cheshire
Emulating Web Browser in a Dedicated Intermediary Box
Acts 16 Nkjv
Quick Base Dcps
Advance Auto.parts Near Me
Autozone Battery Hold Down
Canvas Elms Umd
Who uses the Fandom Wiki anymore?
Barber Gym Quantico Hours
Gummy Bear Hoco Proposal
Helpers Needed At Once Bug Fables
Pilot Travel Center Portersville Photos
91 East Freeway Accident Today 2022
Tamilblasters.wu
Lake County Fl Trash Pickup Schedule
Inside the Bestselling Medical Mystery 'Hidden Valley Road'
Cataz.net Android Movies Apk
Ravenna Greataxe
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.