Credit Card Number Validator (Luhn)

Check whether a card number passes the Luhn checksum and identify its card type.

A quick sanity check on a number

Card numbers carry a built-in checksum — the Luhn algorithm — that catches most typos, like a transposed or mistyped digit. This checks whether a number passes that checksum and identifies the likely card network from its opening digits, which is exactly the client-side validation a checkout form does before it bothers sending anything anywhere.

Enter a card number and it reports whether it is validly formed.

Valid format, not valid card

It is essential to be clear about what this does and does not mean. Passing the Luhn check means the number is well-formed, not that it is a real, active card with funds — only the card networks can confirm that. The checksum simply catches obvious entry errors early so a form can flag them before submission. This runs entirely in your browser and is meant for testing and validation with test numbers; never enter a real card number into any tool you do not fully trust.

Questions & answers

Does passing the check mean a card is real?

No — it means the number is well-formed and free of obvious typos. Only the card networks can confirm a card is real and active.

What is the Luhn algorithm?

A checksum built into card numbers that catches most single-digit and transposition typos.

Is the number uploaded?

No. The check runs in your browser — though you should only ever use test numbers in any such tool.

More Developer tools