Check whether a number passes the Luhn (mod 10) test, or work out the check digit to append to it. Every doubled digit and the final sum are shown so you can follow, or teach, the algorithm.
Last updated:
Mode
Validate: the full number including its last (check) digit. Calculate: the number without the check digit.
Enter your values to see the result.
Advertisement
Advertisement
How to use the Luhn Algorithm Checker
Choose a mode: validate a full number, calculate a check digit, or check a list.
Type or paste the number. Spaces and hyphens are fine.
Click Check (results also update as you type).
Read the verdict and the correct check digit.
Follow the working table to see each doubled digit and the total.
Worked example: 79927398713
Digit (left to right)
7
9
9
2
7
3
9
8
7
1
3
Double?
×2
×2
×2
×2
×2
check
Value
7
18 → 9
9
4
7
6
9
16 → 7
7
2
3
7 + 9 + 9 + 4 + 7 + 6 + 9 + 7 + 7 + 2 + 3 = 70, and 70 is divisible by 10, so the number is valid. Change any single digit and the sum is no longer a multiple of 10.
GS1 mod 10 (weights 3-1): UPC and EAN barcodes. Similar idea, different weights, see the Check Digit Calculator.
Mod 11: ISBN-10 and ISSN. Catches all single errors and all adjacent swaps, but needs an extra symbol (X) for 10.
Verhoeff and Damm: catch every adjacent transposition too, at the cost of lookup tables.
Frequently asked questions
How does the Luhn algorithm work?
Starting from the rightmost digit (the check digit) and moving left, double every second digit. If a doubled value is greater than 9, subtract 9. Add all the digits together. The number is valid when the total is a multiple of 10.
How do I calculate a Luhn check digit?
Take the number without its check digit, double every other digit starting with the rightmost one, subtract 9 from any result over 9, and add everything. The check digit is (10 − sum mod 10) mod 10. For 7992739871 the sum is 67, so the check digit is 3 and the full number is 79927398713.
Where is the Luhn algorithm used?
It is used for payment card numbers, IMEI numbers of mobile phones, US National Provider Identifiers, Canadian Social Insurance Numbers, and many loyalty and gift card numbers. It was created by IBM scientist Hans Peter Luhn and is described in ISO/IEC 7812-1.
Does passing the Luhn check mean a card number is real?
No. Luhn only detects typing mistakes. About one in ten random numbers passes, so a valid result says nothing about whether an account exists or is active.
Which errors does the Luhn check catch?
It catches every single-digit error and most swaps of two adjacent digits. It misses the swap 09 ↔ 90 and twin errors such as 22 ↔ 55, 33 ↔ 66 and 44 ↔ 77.
Why subtract 9 from doubled digits?
Subtracting 9 from a two-digit result is the same as adding its two digits together: 7 × 2 = 14, and 1 + 4 = 5 = 14 − 9. It keeps every value a single digit.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.