Luhn Calculator – Validate & Generate Check Digits

Free Luhn calculator that runs entirely in your browser. Validate any numeric string against the Luhn (mod-10) checksum, or generate the missing check digit that makes a number valid. It strips spaces and dashes automatically, shows a step-by-step breakdown of every doubled digit and running sum, and works for credit cards, IMEI numbers, and other mod-10 identifiers.

🔒 Pure browser tool — nothing is uploaded.

Input

Enter any numeric string (spaces/dashes OK)

Quick Examples

Click to load:

Valid numbers:
Invalid numbers:
Generate check digit:

Result

Enter a number and click Calculate

Algorithm Explained

  1. Start from the rightmost digit and move left
  2. Double every second digit (positions 2, 4, 6...)
  3. If doubling gives > 9, subtract 9
  4. Sum all digits
  5. Valid if sum mod 10 = 0

How to use the Luhn calculator

  1. Type or paste a number into the input field — spaces and dashes are stripped automatically, so any format works.
  2. Pick a mode: Validate Number checks whether the number already passes the Luhn checksum; Generate Check Digit computes the final digit that makes a partial number valid.
  3. Click Calculate (or press Enter) to see the result, the calculation details, and a full step-by-step breakdown table.
  4. Use Copy on the breakdown, or the copy button on a generated number, to save the result to your clipboard.

The Luhn algorithm is a simple mod-10 checksum that catches most accidental typos and digit transpositions. It is widely used for credit card numbers, IMEI device identifiers, and various national ID numbers — but it is an error-detection scheme, not a security measure.

Working with card numbers specifically? The Credit Card Validator also detects the card brand and shows card-specific details. To understand the math behind the check, read the Luhn algorithm guide.

Frequently Asked Questions

The Luhn algorithm (mod-10) is a checksum formula that validates identification numbers. It doubles every second digit from the right, sums all digits, and checks if the result is divisible by 10.

Any number that uses Luhn validation: credit card numbers, IMEI numbers, Canadian SINs, various national ID numbers, and custom sequences. Enter any numeric string to check.

Enter your number without the check digit, select "Generate Check Digit" mode, and click Calculate. The tool will compute the digit that makes the complete number valid.

Either the number has a typo, or it doesn't use Luhn validation. Not all numeric identifiers use Luhn—some use different checksum algorithms.

Yes, but our dedicated Credit Card Validator also detects card type and shows card-specific information. This tool is more general-purpose.

Each digit, whether it was doubled, the result after doubling (subtracting 9 if over 9), and the running sum. The final sum should be divisible by 10 for valid numbers.

All processing happens in your browser—nothing is sent to any server. However, avoid entering real credit card numbers in any online tool.

Yes. The tool strips all non-numeric characters before validation. Enter numbers in any format.

There's no strict limit, but Luhn is typically used for numbers between 8-19 digits. Very long numbers may have display issues.

Luhn catches all single-digit errors and most transpositions. It's highly effective for error detection but not designed for security or fraud prevention.