Text-Converters

Luhn Algorithm Validator

Check if a number (like a credit card number) is valid using the Luhn algorithm (mod 10 check).

Number to Validate
About the Luhn Algorithm

The Luhn algorithm, also known as the 'modulus 10' or 'mod 10' algorithm, is a simple checksum formula used to validate a variety of identification numbers, such as credit card numbers, IMEI numbers, and National Provider Identifier numbers. It was developed by IBM scientist Hans Peter Luhn and patented in 1960. The formula is designed to protect against accidental errors, such as a mistyped digit, but it is not a cryptographically secure hash.

  1. Starting from the rightmost digit (excluding the check digit) and moving left, double the value of every second digit.
  2. If the result of this doubling operation is a two-digit number, add the two digits together to get a single-digit number (e.g., 14 becomes 1 + 4 = 5).
  3. Sum all the digits together (including the digits that were not doubled).
  4. If the total sum modulus 10 is equal to 0 (i.e., the total sum ends in a zero), then the number is valid according to the Luhn formula; otherwise, it is not valid.

Does a valid number mean the credit card is real?

No. The Luhn algorithm only checks if the number is plausible, it doesn't verify if the card is active, has funds, or is a legitimate account. It is primarily a check against typos during manual entry.

Can I enter numbers with spaces or dashes?

Yes. The tool automatically strips any non-digit characters (like spaces or dashes) before performing the validation, so you can paste formatted numbers directly.

Is my data secure?

Yes. All validation is performed on your device in your browser. The number you enter is never sent to our servers.