By Debmedia Technologies LLP · Kolkata, India · Updated
What Is It and When Do You Need It?
The Luhn check digit is a safety net against typing mistakes. Developers use it to reject bad numbers before they reach a server.
Choose whether to generate a digit or to check a full number.
How to Use This Tool
- Enter or paste your input in the box or boxes above.
- Choose the options, if there are any.
- Press the button to run the tool.
- Read the result and use the copy button where one is shown.
How the Calculation Works
Working from the right, every second digit is doubled. If doubling gives more than 9, 9 is subtracted. All digits are added. A full number is valid if the total is a multiple of 10. To generate a digit, the tool treats the check position as the rightmost digit and chooses the digit that brings the total to a multiple of 10.
Worked Example
The digits 7992739871 need the check digit 3, giving 79927398713, which passes the Luhn test.
Common Uses
- Form validation.
- Learning about check sums.
- Making test data.
- Checking IMEI and card numbers.
Tips and Common Mistakes
- Remove spaces and dashes (the tool does it for you).
- Never type a real card number into any website you do not trust.
- Use the ISBN validator for book numbers.
- Check the first result against a case you already know, so you can trust the tool for the rest.
- Nothing you type leaves your device. The work is done by your browser, so it also works with a slow connection once the page has loaded.
Related Tools
Next, you may need the ISBN validator, modulo calculator, prime number checker, GCD and LCM calculator.
Everything runs in your browser. Nothing you type is uploaded, stored or sent to any outside service.
Frequently Asked Questions
Disclaimer: results are calculated in your browser from the numbers you enter. Check important results before you rely on them for money, health, safety or legal decisions.