2026-11-12

The Luhn checksum: why the last digit of a card is a checksum

The last digit of a card number is not part of the account — it is a check digit computed with the Luhn algorithm (mod 10). Its job is to catch typos before a number reaches a gateway.

How it works

  1. Start at the last digit (the check digit) and move left.
  2. Double every second digit.
  3. If a result exceeds 9, subtract 9.
  4. Add everything up.
  5. If the total is a multiple of 10, the checksum is valid.

What it catches, and what it does not

It catches 100% of single-digit typos and roughly 90%+ of adjacent transpositions. It cannot tell you whether the card exists — a fabricated number can pass.

A valid checksum does not mean a real card. The card generator intentionally produces fake numbers with valid checksums.

Try it

Open the Luhn validator and paste a number, or generate checksum-valid fake numbers in the generator.