Luhn validator

Luhn validator

Type a test card number to see its card network, how many digits it should have and whether it passes the Luhn check. The result updates as you type. The check tests the format only: it does not show whether a card exists or can be charged.

Use a test number, not a real card.

The validator needs JavaScript. Turn it on in your browser to check a number.

Test numbers

These numbers pass the Luhn check and are widely published for testing card forms.

  • Visa: 4111 1111 1111 1111
  • Mastercard: 5555 5555 5555 4444
  • American Express: 3782 822463 10005
  • Discover: 6011 1111 1111 1117

Step by step

How the Luhn check works

Step 1

Start from the last digit and move left.

Step 2

Double every second digit. If the result is more than 9, subtract 9.

Step 3

Add up all the digits.

Step 4

If the total ends in 0, the number passes.

What it does not tell you

The Luhn check catches mistyped numbers. It does not show whether the card exists, is open or can be charged, or which bank issued it. Our card capture form runs the same check as each card number is typed in, and our risk assessment returns the issuing bank and country.

Related: Tokenization · Store cards securely