Luhn Formula

Based on ANSI X4.13, the LUHN formula (also known as the modulus 10, or mod 10, algorithm) is used to generate and/or validate and verify the accuracy of credit-card numbers.

Credit Card Check Digit

Most credit cards contain a check digit, which is the digit at the end of the credit card number. The first part of the credit-card number identifies the type of credit card (Visa, MasterCard, American Express, etc.), and the middle digits identify the bank and customer.


Here’s how the algorithm works for verifying credit cards; the math is quite simple:




The LUHN formula was created in the late 1960s by a group of mathematicians. Shortly thereafter, credit card companies adopted it. Because the algorithm is in the public domain, it can be used by anyone.

The LUHN formula is also used to check Canadian Social Insurance Number (SIN) validity. In fact, the LUHN formula is widely used to generate the check digits of many different primary account numbers. Almost all institutions that create and require unique account or identification numbers use the Mod 10 algorithm.

Webopedia Staff
Webopedia Staff

Top Articles

List of Windows Operating System Versions & History [In Order]


How to Create a Website Shortcut on Your Desktop




Hotmail [Outlook] Email Accounts


XiaoBa Ransomware


Team Management Software


Kaseya Ransomware Attack
