How this instrument works
The Luhn checksum is an arithmetic pass built to catch the kind of slip that swaps two adjacent digits or fat-fingers a single key. Starting from the rightmost digit and moving left, every second position gets doubled; whenever that doubling pushes past 9, subtracting 9 brings it back to a single digit. Add all eight resulting values together, and a correctly typed number always produces a total divisible by 10 — a check value of zero. Anything else means one of those eight digits was likely mistyped.
Why subtract 9 rather than leave the doubled value as it is? Doubling anything from 5 through 9 produces a two-digit result — 5 becomes 10, 9 becomes 18 — and subtracting 9 is a shortcut for adding those two digits together instead of juggling a bigger number. Double 8 to get 16, subtract 9 for 7, which is the same 7 you'd reach by summing 1 and 6. That one subtraction keeps every term a plain single digit, which is what makes the whole pass easy to run on paper.
Nothing else on this site runs this particular check — it isn't a variant of a modulo page here, just its own distinct pattern of doubling, subtracting, and summing applied to fixed positions in a number. This sheet is scoped to exactly eight digits so every position gets its own labeled box rather than an open-ended text field, but the mechanic itself does not care about length: a sixteen-digit card number gets the identical alternating-double treatment before its own check digit gets compared against zero.
- Enter each digit of your 8-digit number into Digit 1 (leftmost) through Digit 8 (rightmost), one field per position.
- Read Luhn check value (0 = valid): a result of 0 means the number passes.
- A nonzero result flags a likely typo somewhere among the eight digits entered.
- Change a single digit and re-read the check value to see how one position affects the outcome.
- Keep in mind this sheet checks exactly eight digits; real card numbers apply the same rule over more positions.
Worked example — checking 40000002
Enter 4, 0, 0, 0, 0, 0, 0, 2 into Digit 1 through Digit 8, spelling out 40000002. Counting from the rightmost digit, positions two, four, six, and eight get doubled: the rightmost 2 stays a 2, the digit just left of it, a 0, doubles to 0, and the 4 sitting in Digit 1, eight places in from the right, doubles to 8. Every other digit here is already 0. Summing all eight values — 2, 0, 0, 0, 0, 0, 0, 8 — gives 10, and 10 mod 10 is 0, so Luhn check value reads 0: this number passes.
Now change the digits to 1, 2, 3, 4, 5, 6, 7, 0, spelling out 12345670, and the result flips. Doubling reaches the 7, 5, 3, and 1 this time: 7 doubles to 14, reduced to 5; 5 doubles to 10, reduced to 1; 3 doubles to 6; 1 doubles to 2. Adding every value — 0, 5, 6, 1, 4, 6, 2, 2 — totals 26, and 26 mod 10 is 6, not 0, so Luhn check value reads 6: this particular number fails.
Questions
What counts as a pass on the Luhn check?
A check value of exactly 0. This sheet doubles every second digit counting from the rightmost position, subtracts 9 from any doubled result over 9, adds all eight values, and reduces that total modulo 10 — landing on 0 means the eight digits entered are internally consistent, the way a genuine card or ID number would be.
Why subtract 9 instead of just using the doubled digit?
Subtracting 9 from a doubled value over 9 is identical to adding its two digits together, and that keeps every term a single digit. Doubling 6 gives 12, and 12 minus 9 is 3 — the same 3 reached by adding 1 and 2. The subtraction is a shortcut, not a separate rule layered on top.
Does the check work on numbers longer than eight digits?
Yes. The doubling pattern, alternating from the rightmost digit, extends to any length. This sheet fixes the length at eight purely so each position has its own labeled field, but a sixteen-digit card number runs through identical steps: double every second digit from the right, subtract 9 where needed, sum, and check for a multiple of 10.
What kind of errors does the Luhn check actually catch?
Single mistyped digits and adjacent-digit swaps, the most common slip when keying a long number by hand. It is not a security measure and never verifies that a number was genuinely issued to anyone — it only confirms the digits are arithmetically self-consistent, catching accidental typing mistakes rather than deliberate fabrication.
Is a check value of 0 proof that a card number is real?
No. Plenty of numbers nobody ever issued will still pass, since the check tests arithmetic structure only, not whether an issuer created that particular sequence. All zeros passes trivially, for instance. Passing the Luhn check is a necessary property of a valid number, never a sufficient one on its own.
Why does this calculator only accept exactly 8 digits?
To keep the input as plain labeled fields, one digit per box, instead of a free-text string needing its own parsing logic. The underlying mechanic pays no attention to length, so the same steps shown here would apply unchanged if the fields were extended to sixteen positions or more.