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.

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.

To generate the check digit, the LUHN formula is applied to the number. To validate the credit-card number, the check digit is figured into the formula.

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

1) Starting with the second to last digit and moving left, double the value of all the alternating digits.

2) Starting from the left, take all the unaffected digits and add them to the results of all the individual digits from step 1. If the results from any of the numbers from step 1 are double digits, make sure to add the two numbers first (i.e. 18 would yield 1+8). Basically, your equation will look like a regular addition problem that adds every single digit.

3) The total from step 2 must end in zero for the credit-card number to be valid.

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.

Read Also:

  • Lycos

    A popular World Wide Web search engine and directory. Like Excite, Lycos offers a full-text search engine, a directory of Web sites organized by category, and reviews of selected sites.

  • label

    (1) A name. (2) For mass storage devices, a label is the name of a storage volume. It is sometimes referred to as a volume label. Each operating system has its own set of rules for labeling volumes. The label provides a mnemonic name that indicates what type of information is stored on the media. […]

  • lamer

    A slang term used to describe a user who is uneducated in a given topic area or one who behaves stupidly when involved in online communities. The word most often associated with and used in place of newbie. Similar slang terms include llama, which is specifically used in online gaming chat rooms and on multiplayer […]

  • land

    The raised area on a CD or DVD where data is stored. CDs and DVDs store data in lands and pits. The lands represent 1 and the pits represent 0 in binary computing. The bits are read by the disc drive that uses a laser beam to distinguish between the lands and pits based on […]

  • landing zone

    (n.) A non-data space on a computer’s hard disk where the read/write heads rest, or park, when the computer’s power is turned off.


Disclaimer: Luhn formula definition / meaning should not be considered complete, up to date, and is not intended to be used in place of a visit, consultation, or advice of a legal, medical, or any other professional. All content on this website is for informational purposes only.