Luhn algorithm checker and generator

About this tool

Validate card-style numbers with the Luhn algorithm directly in your browser. This tool is useful for testing forms, verifying identifiers, and understanding how checksum validation works.

Paste a full number to verify whether it passes the checksum, or enter a partial number to calculate the missing check digit.

All calculations run client-side with no server round-trip.

Length must be 13 to 19 digits. example

Validation

Valid Luhn number

Current input: 3782 8224 6310 005

Generate last digit

Generated number with highlighted check digit:

3782 8224 6310 005

Last digit changed from 5 to 5.

How it works

  1. Starting from the right, double every second digit.
  2. If doubling produces a number above 9, subtract 9.
  3. Add all digits together.
  4. A valid number has a total divisible by 10.

FAQ

What is the Luhn algorithm used for?

It is a checksum formula commonly used to validate payment card numbers and other identifiers before deeper processing happens.

Can this generate a missing check digit?

Yes. Enter a partial number without the final digit and the tool will calculate the check digit needed to complete it.

Does this tool store anything?

No. The validation and check digit calculation stay in your browser.