Home · Everyday · Bases, Binary & Logic · Luhn Algorithm Calculator

Luhn Algorithm Calculator

The Luhn check on a number — the mod-10 checksum inside card numbers, IMEIs and many ID schemes.

Your figures

Example result — edit the figures to make it yours

Valid (Luhn check passes)

Luhn verdict

The Luhn algorithm doubles every second digit from the right, subtracts 9 from any doubled value over 9, and sums: a valid number's total is a multiple of 10. It catches typos and transpositions — it is an error check, not proof a card exists or is funded. The headline figure codes valid as 1.

Luhn sum80
Correct check digit for this prefix0
Digits16

What this calculator does

The Luhn check on a number — the mod-10 checksum inside card numbers, IMEIs and many ID schemes. Where a measure is involved, US and metric units are both accepted — flip the unit toggle and the figures convert with the same definitions the formula uses. Every result on this page is computed from the formula stated below, with no hidden rounding steps.

The formula and method

Double every second digit from the right, subtract 9 if over 9, sum: valid when the total ends in 0

The Luhn algorithm doubles every second digit from the right, subtracts 9 from doubles over 9, and sums everything.

A total divisible by 10 passes the checksum.

Passing Luhn means the number is well-formed, not that an account exists.

Worked example

With the example inputs this page opens with, the result is Valid (Luhn check passes) — luhn verdict. The Luhn algorithm doubles every second digit from the right, subtracts 9 from any doubled value over 9, and sums: a valid number's total is a multiple of 10. It catches typos and transpositions — it is an error check, not proof a card exists or is funded. The headline figure codes valid as 1.

Quick reference

Quick reference — the worked example in full
FigureValue
Luhn verdictValid (Luhn check passes)
Luhn sum80
Correct check digit for this prefix0
Digits16

Computed with the same formulas as the calculator above — enter any values there for figures beyond this table.

Common questions

How does the Luhn Algorithm Calculator work?

The Luhn check on a number — the mod-10 checksum inside card numbers, IMEIs and many ID schemes. Number → Valid or invalid. The result updates as you type, and the formula and method on this page state the exact definitions used, so you can reproduce the calculation by hand.

What inputs does the Luhn Algorithm Calculator need?

Number → Valid or invalid. Invalid entries — such as a zero denominator, an out-of-range value or a malformed list — produce a plain-language message instead of a misleading number.

Is the Luhn Algorithm Calculator free to use?

Yes. It runs entirely in your browser with no sign-up, and the same calculator is available as an embeddable widget via the Embed button, so it can be placed on another site with its calculation intact.