Luhn algorithm checker

Applies the Luhn (mod 10) algorithm from ISO/IEC 7812, used in payment card numbers and phone IMEIs to catch typing mistakes.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter number.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

From the right, double every second digit and subtract 9 when the result exceeds 9, then add all digits. The number is valid when the sum is divisible by 10.

Example

Inputs: Number = 4111 1111 1111 1111. Result: Result: Valid; Luhn sum: 30; Check digit to append: 3.

Limits and caveats

  • Passing Luhn only means the number is well formed, not that the card or account exists or is active.
  • Numbers are neither stored nor sent, but avoid typing full real card details on shared devices.

Questions about this tool

Which errors does Luhn catch?

Any single wrong digit and most swaps of two adjacent digits, except swapping 09 and 90.

Can I check an IMEI here?

Yes, an IMEI has 15 digits ending in a Luhn check digit, so enter it in full to see whether it is valid.

What is the difference between the digit to append and the correct last digit?

The first is computed for your number as entered, if you want to add a new final digit. The second treats your last digit as the check digit and shows what it should be.