Format validation, for developers

Credit Card Number Validator

Check whether a card number's digits pass the Luhn checksum, see its likely brand, and generate Luhn-valid test numbers for building and testing checkout forms.

⚠ This only checks number format — it cannot verify if a card is real, active, or authorized. For testing and education only. Never enter a real card number here or anywhere untrusted.

How it works

1

Paste a number

Spaces and dashes are ignored automatically, so you can paste a number in any common format.

2

See the Luhn result

The tool runs the standard Luhn checksum and flags whether the digits form a mathematically valid number.

3

Generate test numbers

Need sample data instead? Pick a brand and generate a fresh Luhn-valid number for your test suite.

FAQ

Does this check if a card is real or active?

No. It only verifies that the number's digits satisfy the Luhn checksum used by all major card networks to catch typos. It cannot tell you whether a card exists, is active, or is authorized for a charge.

What is the Luhn algorithm?

A simple checksum formula that doubles every second digit from the right, sums the digits, and checks that the total is a multiple of 10. It's designed to catch common data-entry mistakes, not fraud.

Are the generated test numbers real cards?

No. They are randomly generated numbers that satisfy the Luhn checksum and a brand's prefix pattern, intended only for testing checkout form validation logic — the same idea used by payment providers' published sandbox test cards.

Try other tools