Calcoid

Luhn Checksum Calculator

Validate any credit card, IMEI, or Luhn-checksum identifier, or generate the check digit for a partial number. Shows the step-by-step mod 10 trace, detects Visa, Mastercard, Amex, and Discover BINs, and flags trivially valid numbers.

Input

Spaces and dashes are stripped automatically. Up to 30 digits.

Quick reference

Luhn (mod 10) is a checksum that catches single-digit typos and most adjacent transpositions in identifiers like credit cards and IMEI numbers.

It is a format check only. A valid Luhn number can still be made up, expired, or unauthorized. Never treat Luhn validity as proof that a card or device is real or active.

Result

Luhn valid

4111 1111 1111 1111

Normalized digits4111111111111111
Digit count16
Detected card typeVisa
All same digitNo

Step-by-step Luhn trace

Pos. (right)DigitDoubled?After x2Adds
164Yes88
151No1
141Yes22
131No1
121Yes22
111No1
101Yes22
91No1
81Yes22
71No1
61Yes22
51No1
41Yes22
31No1
21Yes22
11No1

Sum = 30 and 30 mod 10 = 0. A Luhn-valid number has a sum that is divisible by 10.

Luhn Checksum Examples

Partial numberCheck digitComplete number
7992739871379927398713
4992739871649927398716
12345678141234567814
45320151128303664532015112830366
60111111111111176011111111111117

Frequently Asked Questions about the Luhn Checksum Calculator

What is the Luhn algorithm?
The Luhn algorithm (also called mod 10 or modulus 10) is a simple checksum formula invented by IBM scientist Hans Peter Luhn in 1954 and patented in 1960 (US Patent 2,950,048). The patent expired and the algorithm entered the public domain in 1977, which is why it shows up in so many open standards. From the rightmost digit moving left, every second digit is doubled (and 9 subtracted if the result exceeds 9), then all the digits are summed. The number is valid if the total is divisible by 10.
What errors does Luhn catch and what does it miss?
Luhn catches every single-digit typo and most adjacent-digit transpositions, which together account for the vast majority of human keying errors. It does not catch the specific transposition of 09 to 90 or 90 to 09 (both pairs sum to the same Luhn contribution), nor twin-digit substitutions like 22 swapped with 55. It also will not detect insertions or deletions that change the digit count. Luhn is a cheap, lightweight checksum, not a cryptographic hash.
Where is the Luhn algorithm actually used?
Most magnetic-stripe credit and debit card numbers carry a Luhn check digit (Visa, Mastercard, Amex, Discover, Diners, JCB). It also appears in IMEI device identifiers, the Canadian Social Insurance Number (SIN), the US National Provider Identifier (NPI) for healthcare, some national identifiers (Greek SSN, Israeli ID), survey IDs, and many internal account-number schemes. Anywhere a system needs a quick format check on a hand-keyed identifier, Luhn is the default.
Does a valid Luhn number mean the card is real or authorized?
No. Luhn is only a checksum. For example, 4111 1111 1111 1111 passes the calculation, but that result does not establish an issued or authorized account. Issuer, expiration, authorization, and fraud checks are separate.
Why does the calculator flag numbers like 0000000000000000?
A string of identical digits where the doubling pattern works out to a multiple of 10 will pass Luhn trivially, even though no issuer would ever assign such a number. The flag on all-same-digit inputs is there so you do not mistakenly conclude that a placeholder, test value, or empty form field is a valid identifier. The check digit is doing its job mathematically; the warning is doing its job semantically.

Related Calculators

More calculators in "Tech"

See all 98 calculators in "Tech"