Overview
A client-side card number checker that applies the Luhn checksum, identifies the card network from the number's prefix, and flags unusual lengths. It is a structural validation tool for testing forms and spotting typos — it never contacts a bank and cannot tell whether a number belongs to a real, active account.
How It Works
Type or paste a number into the card number field; digits are grouped in fours automatically and spaces or dashes are ignored. Three tiles show the verdict: whether the Luhn checksum passes, the detected network (Visa, Mastercard, American Express, Discover, Diners Club, JCB, or Unknown), and the digit count. If the checksum fails you get an explicit message that the number cannot be a valid card; if it passes but the length is atypical for the detected network, an amber warning explains that.
Step-by-Step Usage Guide
- Paste the test number into the field; formatting is cleaned automatically.
- Read the Luhn checksum verdict in the first tile.
- Check the detected network and digit length in the other two tiles.
- Heed the amber length warning if the checksum passes but the count is unusual for that network.
Technical Specifications & Standards
The Luhn check is the mod-10 checksum defined by Hans Peter Luhn in 1954: starting from the rightmost digit, double every second digit, subtract 9 from any doubled result above 9, and sum everything — the number is well-formed if the total is divisible by 10. The implementation accepts 12 to 19 digits, which covers every mainstream network. Network detection uses the published prefix rules: a leading 4 for Visa, 51–55 or 22–27 for Mastercard, 34 or 37 for American Express, 6011 or 65 for Discover, the 30/36/38 ranges for Diners Club, and 35 for JCB. Length guidance is 16 digits for Visa, Mastercard, and Discover, 15 for Amex, and 14 for Diners Club, with a permissive fallback list for unknown networks. Understand the boundary of the check: a passing Luhn sum is necessary but nowhere near sufficient — roughly one in ten random digit strings passes — and the tool validates neither expiry, nor CVV, nor whether the account exists. The field's own hint says never to enter a card you do not own; there is no reason to, since a bank or payment gateway does the real verification.
Targeted Use Cases
- Generating or checking structurally valid test numbers for a payment-form demo.
- Debugging why your form's card field rejects a number (usually a typo the Luhn check catches).
- Verifying that a stored test card still passes validation after a refactor.
- Teaching how the mod-10 checksum works by entering deliberately wrong digits.
Notes & Gotchas
- Use only test numbers such as payment gateways' published sandbox cards, never a real card.
- Treat a Luhn failure as a typo detector, and a pass as 'well-formed', not 'real'.
- Remember expiry and CVV are outside this check by design.
- Pair it with your own length rules if your gateway is stricter about a single network.
Frequently Asked Questions
What does the Luhn check actually verify?
Only the internal consistency of the digit string. It is a mod-10 checksum that catches single-digit typos and most transpositions; it says nothing about whether the account exists, is open, or has funds.
Is my card number stored or sent anywhere?
No. Validation is a few lines of arithmetic running in your browser, and nothing is logged, stored, or transmitted. Even so, there is no reason to type a real card — use sandbox test numbers.
Which networks can it detect?
Visa (leading 4), Mastercard (51–55 or 2221–2720 prefixes), American Express (34, 37), Discover (6011, 65), Diners Club, and JCB (35). Numbers outside these patterns are labelled Unknown but still get a checksum verdict.
Why does a number pass the checksum but still look wrong?
The checksum accepts many digit strings that no issuer uses. That is why the tool separately checks the digit count against the typical lengths for the detected network and warns you when they disagree.