%3C/text%3E%3C/svg%3E">
💻
💻 Tech & IT

Luhn Check Digit Calculator (validation)

Results update as you type.

Your numbers

Understanding the Luhn check digit calculator — concept and principle

The Luhn algorithm, also called the mod 10 algorithm, adds one check digit to the end of an identification number so that typing errors can be caught immediately. It is used for payment card numbers (as specified in ISO/IEC 7812), IMEI numbers of mobile phones and many account or membership numbers. This calculator gives the check digit to append to your digits and tells you whether the number as entered already passes the Luhn test.

Luhn check digit for 7992739871With a 0 appended, doubled digits give 2, 7, 6, 4, 9 = 28, the rest 39; 67 needs 3 more to reach 70, so the check digit is 3.Luhn: double every second digit from the right77×2991+899×22477×23699×2871+677×212+000doubled2 + 7 + 6 + 4 + 9 = 28others0 + 7 + 9 + 7 + 9 + 7 = 3967 → check digit 3(10 − 7) mod 10 = 3 → 79927398713
Doubled digits over 9 have their digits added (16 → 7); the total must end in 0.

How it is calculated

  1. Starting from the rightmost digit of the number that will be checked, number the positions 1, 2, 3 … from right to left.
  2. Double every digit in an even position. If doubling gives more than 9, subtract 9 (the same as adding its two digits, e.g. 16 → 1 + 6 = 7).
  3. Add all the digits, doubled and undoubled.
  4. A number is valid when this sum is a multiple of 10.
  5. To find a missing check digit, append 0, compute the sum S, and take (10 − S mod 10) mod 10.

Non-digit characters such as spaces and hyphens are ignored.

The principle

Doubling with "subtract 9" maps the digits 0–9 to 0, 2, 4, 6, 8, 1, 3, 5, 7, 9, a permutation, so changing any single digit always changes the sum mod 10 and is detected. Alternating the weight between 1 and 2 also catches swaps of two adjacent digits, because the swapped digits end up with different weights. The one adjacent swap it misses is 09 ↔ 90, since both contribute 9. H. P. Luhn of IBM patented the method in 1960.

Worked example

  1. Input: 7992739871.
  2. Append 0: 79927398710. From the right, the doubled digits are 1, 8, 3, 2, 9, giving 2, 16 → 7, 6, 4, 18 → 9, which sum to 28.
  3. The undoubled digits are 0, 7, 9, 7, 9, 7, which sum to 39. Total S = 67.
  4. Check digit = (10 − 67 mod 10) mod 10 = (10 − 7) mod 10 = 3, so the full number is 79927398713.
  5. The input itself: taking its last digit 1 as the check digit, the sum is 56, which is not a multiple of 10, so it is invalid.

How to read the result

"Valid" means only that the digits are internally consistent. On average, a random sequence passes one time in ten, so the test filters typing mistakes but says nothing about whether an account exists or is active. If your number is reported invalid, the most likely causes are one wrong digit, two swapped neighbours or a missing digit.

Common mistakes

Keep in mind: Use only test numbers or your own data. A Luhn-valid number is not a working card, and generating or trying card numbers that belong to others is illegal in many countries.

Frequently asked questions

Can Luhn correct an error?

No. It only shows that something is wrong, not which digit.

Does Luhn catch every transposition?

It catches every adjacent swap except 09 ↔ 90; swaps of digits further apart may go undetected.

Are IMEI numbers Luhn-checked?

Yes, the 15th digit of an IMEI is a Luhn check digit over the first 14.

Sources: ISO/IEC 7812-1, Identification cards — Identification of issuers — Part 1: Numbering system · H. P. Luhn, Computer for Verifying Numbers, U.S. Patent 2,950,048 (1960)

Checked 8 Nov 2026. Standard formulas and RFC/IEEE definitions, computed locally in your browser — nothing you type is sent anywhere.

💻 All tech & IT tools →🌍 Calculators by country →