TestCardsGet a free key

Luhn algorithm validator

The Luhn algorithm (also called mod 10) is the checksum that catches most accidental mistyped digits in a card number. Paste a number to check whether it passes and see the detected scheme. This is a structural check only — it does not tell you whether a card is real, active, or has funds.

Runs entirely in your browser — nothing is sent to a server. The Luhn check only verifies the checksum digit; it does not mean a card is real, active, or has funds.

How the Luhn check works

  1. Starting from the rightmost digit, double every second digit.
  2. If doubling produces a number greater than 9, subtract 9 from it.
  3. Sum all the digits.
  4. If the total is a multiple of 10, the number passes the Luhn check.

Want it in code or in CI? Hit the Luhn API, or grab ready-made fixtures from the test-card generator and the Stripe test cards reference.