Credit Card Validator (Luhn + Brand)
Validate a card number with the Luhn checksum, detect brand (Visa/MC/Amex/etc), and check expected length. Local, no network.
Enter a card number above.
⚠ Don't paste real cards into web tools. Use processor test numbers (e.g. Stripe's 4242 4242 4242 4242).
Detects brand from BIN/IIN prefix, validates length per brand, then runs Luhn mod-10. All local — nothing leaves your browser.
How to use
- Paste or type a card number. Spaces and dashes are stripped automatically.
- Watch the brand badge update as you type.
- ✓ valid means brand-correct length and Luhn pass. Real authorization still needs your processor.
About this tool
ShowHide
Card numbers (PAN) embed a brand-specific Issuer Identification Number, an account number, and a final Luhn check digit. This tool: (1) detects brand from leading digits (Visa, Mastercard, Amex, Discover, JCB, Diners, UnionPay, Maestro), (2) checks the length matches that brand's spec, (3) runs the Luhn mod-10 checksum. Useful for client-side form validation — catches typos and obvious fakes before the payment processor sees them.
Luhn catches the mistakes people actually make, which is what it was designed for in the 1950s. Every single-digit error fails the check, and so does almost every transposition of two adjacent digits, the two commonest ways a number gets typed wrong. The exception is worth knowing: swapping 09 for 90 passes, because the doubling step maps both to the same value. That is the one transposition Luhn cannot see.
What the check cannot tell you is whether the card exists. Roughly one in ten random numbers of the right length passes Luhn by chance, so a number can be brand-correct, length-correct and checksum-valid while belonging to no account anywhere. Only an authorisation against the issuer answers that, and nothing running in a browser can. Treat a pass as evidence of no typo and nothing more.
The brand prefixes move. Issuer Identification Numbers are allocated and reallocated, ranges get added, and a table baked into client code drifts out of date rather than failing loudly: the symptom is a legitimate new card reported as an unknown brand. Refusing a payment on that basis turns a stale table into lost revenue, which is why brand detection belongs in the interface and never in the decision.
A card number is regulated data. PCI DSS governs storing or transmitting a PAN, which is why this runs entirely in the page and sends nothing, and it is also why a real form should hand the number to a processor's hosted field rather than to your own server.
Frequently asked questions
Does Luhn-passing mean the card is real?
No. Luhn only catches typos. A randomly generated Luhn-valid number is almost certainly not issued to anyone. Real validity needs your payment processor (Stripe, Adyen, etc) to attempt authorization.
Which brands are detected?
Visa, Mastercard, American Express, Discover, JCB, Diners Club, UnionPay, and Maestro — by leading-digit pattern. Some cards (e.g. private-label store cards) won't match and show as 'unknown'.
Why does Amex show 15 digits?
Amex uses 15-digit PANs and a 4-digit CID (the security code). Visa/MC use 16-digit PANs and a 3-digit CVV. Discover/JCB are 16, sometimes 19.
Is it safe to paste a real card number here?
Computation runs entirely in your browser — nothing is sent over the network. That said, don't paste real cards into random web tools. Use test card numbers for validation testing (e.g. Stripe's 4242 4242 4242 4242).
Related tools
Credit Card Instalment Fee Calculator (Korea)
Work out the fee and each payment for a Korean credit-card instalment plan from the amount, months, annual fee rate and any interest-free months.
Everyday
Email & PII Masker
Mask emails, phone numbers, credit cards, and IP addresses in any text — for screenshots, blog posts, logs.
Text
Check Digit Calculator: Luhn, Verhoeff, Damm
Compute and verify check digits with Luhn, Verhoeff, Damm and the ISO 7064 family (MOD 11-2, 97-10, 37-2…), and see which typing errors each one catches.
Developer
JSON Schema Validator
Check a JSON document against a JSON Schema in your browser. Every error gets its JSON Pointer, the line it lands on, and the keyword that failed.
Developer
JSON to Zod Schema Generator
Turn a JSON object into a Zod validation schema with inferred types, in your browser.
Developer
Invisible / Zero-Width Character Detector
Spot NBSPs, zero-width characters, bidi marks, and tabs in pasted text — then clean them out.
Developer