Credit Card Number Validator

Check a card number against the Luhn checksum and detect its card type.

Result

—

About this tool

Checks whether a card number passes the Luhn checksum that every major card network uses, and identifies the network from the number's prefix and length. It validates only the number's internal structure — it does not check whether a card exists, is active, or has funds, and it cannot. Nothing is sent anywhere; the check runs in your browser.

The Luhn check. Starting from the rightmost digit and working left, double every second digit; if a doubled value exceeds 9, subtract 9. Sum every digit. If the total is a multiple of 10, the number passes. It's a 1950s design meant to be computed on mechanical equipment, which is why it's simple rather than strong. The Luhn algorithm guide walks through it by hand with a worked example.

What "passes" actually means. Only that the digits are internally consistent — no single mistyped digit, no obvious transposition. It's the same check a payment form runs in the browser before it ever contacts a processor, to reject typos early. Passing tells you nothing about whether a bank issued the number, whether the account is open, or whether the expiry and CVV are right.

Network detection. The first digits (the issuer identification number) and the total length identify the network:

NetworkStarts withLength
Visa413, 16, or 19
Mastercard51–55, 2221–272016
American Express34, 3715
Discover6011, 65, 644–64916
Diners Club36, 38, 300–30514
JCB3528–358916

Legitimate uses. Debugging why a checkout form rejects a number, confirming a stored number wasn't corrupted, building or testing client-side validation, and teaching the algorithm. For testing a full payment flow you need format-valid placeholder numbers — the test card number generator produces Luhn-valid ones, and your payment provider publishes specific sandbox numbers that trigger defined gateway responses.

What this is not. It is not a "card checker" — it has no way to query a bank, and never contacts one. Using it, or any tool, to test whether card numbers you don't own are live is fraud. Don't paste numbers that aren't yours.

Privacy. The calculation is plain JavaScript running in your browser. The number is never transmitted or stored, and the page makes no network requests with it.

Frequently asked questions

What is the Luhn algorithm?
A checksum: from the right, double every second digit (subtracting 9 if over 9), sum all digits, and check the total is a multiple of 10. It catches typos, not fraud.
Does passing mean the card is real or active?
No. Luhn validation only confirms the number is internally consistent. It can't tell whether the card was issued, is unexpired, or has a balance.
Is my card number sent anywhere?
No. The check runs entirely in your browser with plain JavaScript. Nothing is transmitted or stored.
Why does it say a number is invalid when I'm sure it's right?
Most often a mistyped or missing digit, or extra characters. Re-enter it carefully. A genuine card number always passes Luhn.
Can this check if a stolen card works?
No, and attempting that with any tool is a crime. This only does offline math on a number you enter.
Which networks does it detect?
Visa, Mastercard, American Express, Discover, Diners Club, and JCB, from the number's prefix and length.
Why does the card graphic turn red or green?
It's a quick visual echo of the Luhn result — green means the number you entered passes the checksum, red means it fails. It's purely a display convenience; the "Result" and "Detected card type" readouts underneath give the same information as text.
Is the graphic based on a real card design?
No — it's a generic mockup (network label, chip icon, grouped digits) purely to make the number easier to read at a glance, not a reproduction of any bank's or network's actual card artwork.