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
Custom Canvas Prints | Large Canvas Prints - Canvaspop
OTE — Indicateurs et Signaux — TradingView
WALB Locker Room Report Week 5 2024
Tiny Tina Deadshot Build
Riverrun Rv Park Middletown Photos
Hotels
Uihc Family Medicine
Santa Clara College Confidential
EY – все про компанію - Happy Monday
Aiken County government, school officials promote penny tax in North Augusta
Gameplay Clarkston
Full Range 10 Bar Selection Box
Weekly Math Review Q4 3
Spelunking The Den Wow
Skylar Vox Bra Size
Truth Of God Schedule 2023
Wal-Mart 140 Supercenter Products
Comics Valley In Hindi
Bj Alex Mangabuddy
Kiddle Encyclopedia
Tamilyogi Proxy
Palm Springs Ca Craigslist
MLB power rankings: Red-hot Chicago Cubs power into September, NL wild-card race
Morristown Daily Record Obituary
Violent Night Showtimes Near Century 14 Vallejo
The Boogeyman (Film, 2023) - MovieMeter.nl
Belledelphine Telegram
Preggophili
Danielle Moodie-Mills Net Worth
His Only Son Showtimes Near Marquee Cinemas - Wakefield 12
Neteller Kasiinod
Happy Shuttle Cancun Review
Chadrad Swap Shop
Was heißt AMK? » Bedeutung und Herkunft des Ausdrucks
Ofw Pinoy Channel Su
Solve 100000div3= | Microsoft Math Solver
Exploring TrippleThePotatoes: A Popular Game - Unblocked Hub
RUB MASSAGE AUSTIN
Weekly Math Review Q4 3
Supermarkt Amsterdam - Openingstijden, Folder met alle Aanbiedingen
Facebook Marketplace Marrero La
Easy Pigs in a Blanket Recipe - Emmandi's Kitchen
M Life Insider
Firestone Batteries Prices
Beaufort SC Mugshots
Craigslist Rooms For Rent In San Fernando Valley
Go Nutrients Intestinal Edge Reviews
Mejores páginas para ver deportes gratis y online - VidaBytes
Rétrospective 2023 : une année culturelle de renaissances et de mutations
Room For Easels And Canvas Crossword Clue
Dr Seuss Star Bellied Sneetches Pdf
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.