Luhn Algorithm Calculator (Check Digit)
Type a number to see if it passes the Luhn check, or leave off the last digit to get the check digit.

How to use the Luhn Algorithm Calculator
- Under ‘What do you want to do?’, choose one of three options: ‘Check a number’, ‘Find the check digit’, or ‘Check many numbers (table)’.
- With ‘Check a number’, type the whole number into the Number field, including its last digit.
- With ‘Find the check digit’, type the number into the Number field without its check digit. The result shows the check digit and the number with it added.
- With ‘Check many numbers (table)’, paste your numbers into ‘Numbers to check’. Put one number on each line, or separate them with commas. Each number must include its check digit. One run handles up to 5,000 numbers.
- Read the result. For a single number, look at ‘Luhn check’ (Valid or Wrong check digit), ‘Luhn sum’ and ‘Digits entered’. For a list, read the ‘Result’ summary line, then the table with Input, Check digit expected, Last digit given and Luhn check.
- Below the result, the calculation table shows each digit with its Position from right, Digit, Doubled? and Value used, plus the Sum.
Spaces and hyphens are ignored. Enter digits only, up to 64 digits in the Number field.
The example buttons (‘79927398713’, ‘Find check digit’, ‘IMEI example’, ‘Wrong digit’ and ‘Bulk table’) load sample inputs so you can see each mode in action. Copy link keeps your inputs in the page address, and Print / save as PDF prints the inputs, the result, the working and the date.
What is the Luhn algorithm?
The Luhn algorithm, also called the Luhn formula or mod 10 method, is a checksum formula. It produces one check digit that is added to the end of a number. When someone later types the full number, the formula can tell whether the digits still fit together. It was designed to catch typing errors in identification numbers. It does not prove that a number exists or was issued. It only checks that the digits are consistent with each other.
Luhn’s algorithm, also written Luhn’s formula, appears in many everyday numbers. Credit and payment card numbers use it, and so do IMEI numbers of mobile devices, ICCID numbers of SIM cards, and several national ID numbers.
How does the Luhn algorithm work?
The calculation starts with the payload, which is the number without its check digit. To work out the check digit, follow these steps:
- Start at the rightmost digit of the payload and count positions from the right.
- Double every digit in an odd position (1st, 3rd, 5th and so on).
- If a doubled digit is greater than 9, subtract 9 from it.
- Add all the resulting digits, including the digits you did not double.
- Find the check digit: subtract the sum modulo 10 from 10, then take modulo 10 again. In short, (10 - (sum mod 10)) mod 10.
Take the payload 7992739871. Doubling the digits in positions 1, 3, 5, 7 and 9 from the right gives 1 becoming 2, 8 becoming 16 and then 7, 3 becoming 6, 2 becoming 4, and 9 becoming 18 and then 9. The undoubled digits add to 39 and the doubled digits add to 28, so the sum is 67. The check digit is (10 - 7) = 3, giving the full number 79927398713.
To validate a number, drop its last digit, recompute the check digit from the rest, and compare the result with the digit you dropped. In 79927398713, the expected digit is 3 and the last digit is 3, so the number is valid. In 79927398710, the expected digit is still 3 but the last digit is 0, so it fails.
Worked examples
| Input | Result |
|---|---|
| 79927398713 | Valid (check digit 3) |
| 7992739871 | Check digit 3 → 79927398713 |
| 490154203237518 | Valid (check digit 8) |
| 79927398710 | Fails; the check digit should be 3 |
| 3 numbers | 3 checked: 2 valid, 1 with a problem |
Calculated by the tool above with these values.
Frequently asked questions
What does the Luhn algorithm detect?
It detects all single-digit errors and almost all transpositions of two adjacent digits. It does not catch swapping 09 and 90 in either direction, or the twin errors 22 and 55, 33 and 66, and 44 and 77 swapped in either direction.
Does a number that passes the Luhn check mean it is real?
No. A passing number has consistent digits, but that does not show the number was issued or that an account or device exists. Only the organisation that issues the number can confirm that.
Is the Luhn checksum the same as the Luhn check digit?
They are closely related. The Luhn checksum is the total you get after doubling and adding the digits. The Luhn check digit is the single digit that makes the full number’s total a multiple of 10.
Which numbers use the Luhn algorithm?
Common examples include credit and payment card numbers, IMEI numbers of mobile devices, ICCID numbers of SIM cards, CUSIP numbers of North American financial instruments, US National Provider Identifiers, Canadian Social Insurance Numbers, and several national ID numbers.
Does this tool generate card numbers?
No. The tool only checks or completes the digits you type. It does not generate payment card numbers, and nothing you enter is sent anywhere.
Why does my barcode fail the Luhn check?
Retail barcodes such as UPC, EAN and GTIN do not use the Luhn algorithm. They use a mod 10 method with alternating weights of 3 and 1. Shipping container numbers use a mod 11 method instead.
Related tools
- UPC Check Digit Calculator (GTIN, EAN, SSCC) — for GTIN, EAN and SSCC numbers, which use weights of 3 and 1 instead of Luhn
- Container Check Digit Calculator (ISO 6346) — check shipping container numbers, which use a mod 11 method
- GTIN Generator — build a list of GTINs with correct check digits from your company prefix
- UPC Barcode Generator — retail UPC-A and UPC-E symbols whose last digit is a GS1 check digit
- Random Barcode Generator — random test barcodes with valid check digits
- SSCC Label Generator (GS1 Logistic Label) — create a GS1 logistic label with a valid SSCC check digit