Skip to main content
Number tools100% FreeInstant

Luhn Check Digit Generator and Verifier

This free tool works out the Luhn (mod 10) check digit for a number and tests whether a complete number is valid. The Luhn rule is used for payment cards, IMEI numbers and many ID numbers.

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

  1. Enter or paste your input in the box or boxes above.
  2. Choose the options, if there are any.
  3. Press the button to run the tool.
  4. 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.

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

A simple check-sum from 1954. From the right, double every second digit, add up the digits and make sure the total ends in zero.
To catch typing mistakes in card numbers, IMEI numbers, some national IDs and other long numbers.
No. It only means the digits are consistent. Anyone can make a number that passes.
It catches all single-digit errors and most swaps of neighbouring digits, but not all errors.

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.