InfyCalculator
💻

Luhn Algorithm Calculator (Mod 10 Check Digit)

Validate a number with the Luhn (mod 10) checksum or generate its check digit — used on credit cards, IMEI and many ID numbers — with the doubling step by step.

Number
Mode
Loading calculator…

How it works

From the rightmost payload digit, double every second digit (subtract 9 if the result exceeds 9) · sum all digits · check digit = (10 − sum mod 10) mod 10 · a full number is valid when its total sum is a multiple of 10

The Luhn algorithm (mod 10 algorithm, Hans Peter Luhn, 1954) is a simple checksum that catches every single-digit typo and most swaps of adjacent digits. It is used on payment card numbers, IMEI phone identifiers, Canadian social insurance numbers and many loyalty and account numbers. It is not encryption and says nothing about whether a card or account actually exists — it only checks that the digits are self-consistent.

Worked example

For the payload 7992739871, double every second digit starting from the rightmost (1 → 2, 8 → 16 → 7, 3 → 6, 2 → 4, 9 → 18 → 9) and keep the others (7, 9, 7, 9, 7). The sum is 67, so the check digit is (10 − 7) mod 10 = 3 and the full number is 79927398713.

Sources: Luhn algorithm — Wikipedia · ISO/IEC 7812-1 — Identification cards: numbering system

Frequently asked questions

Does a valid Luhn number mean the credit card is real?

No. About one random number in ten passes the Luhn check. It only catches typing mistakes; whether a card exists is decided by the issuing bank.

Which errors does the Luhn algorithm detect?

All single-digit errors and almost all transpositions of adjacent digits (except 09 ↔ 90). It does not catch every twin error such as 22 ↔ 55.

How do I validate an IMEI number?

An IMEI has 15 digits and the last one is a Luhn check digit. Choose “Validate a full number” and enter all 15 digits.

Why subtract 9 after doubling?

Subtracting 9 from a two-digit result is the same as adding its digits (16 → 1 + 6 = 7), which is how the algorithm is defined.

Related calculators

This calculator is for educational purposes. Double-check important results before acting on them.