Credit Card Validator
Validate a card number with the Luhn check and detect the card brand. Runs locally — your number is never transmitted.
Enter input above to see the result.
What is this for?
Credit card numbers embed two forms of structural validation: a checksum (the Luhn algorithm) that catches typos, and an issuer prefix that identifies the card brand and constrains valid length. This tool runs both checks entirely in your browser — your number never leaves the page — to catch malformed input before it reaches a payment processor or test environment. It's structural validation only: it cannot tell you whether a card is active, issued, or has available funds.
When to use it
- Validating test card numbers copied from payment processor documentation (Stripe, Square, Adyen, etc.). All legitimate test cards pass Luhn.
- Sanity-checking a card number field in development before wiring it to a live or sandbox API — reject obvious typos locally to avoid unnecessary processor requests or test-charge costs.
- Auditing a card number that "looks wrong" — determine whether the issue is a typo (Luhn fails), a length mismatch for the brand, or a non-standard prefix.
- Checking whether a number you've transcribed by hand has been entered correctly without needing to submit a form.
- Building or debugging a payment form validator — compare your client-side logic against this tool's results.
- Verifying the brand of a card number when integrating with processors that require explicit brand declaration.
How it works
- Luhn checksum. The algorithm sums weighted digits and confirms the total is divisible by 10. Any single-digit typo fails this check. It's a bare structural test, not a liveness check.
- Brand detection. The tool matches the first 4–6 digits (the issuer identification number, or IIN) against known prefixes for Visa, Mastercard, American Express, Discover, JCB, Diners Club, and UnionPay. A match also constrains the expected length (e.g. Amex must be 15 digits).
- Length verification. Each brand has a canonical length range. The tool checks that your number's length is valid for its detected brand.
- Client-side only. All processing happens in your browser. The number is never sent to a server, logged, or stored. Close the tab and it's gone.
Common gotchas
- Valid structure ≠ active card. Luhn passing and brand matching only prove the number is well-formed. Real validation (checking whether the card is issued, active, and has available balance) requires contacting a payment processor, which costs money or places a temporary hold.
- Don't paste real card numbers into any tool online. Even though this tool doesn't transmit your number, screen recorders, browser extensions, or an open Developer Tools panel can capture it. Always use a known test card instead.
- Non-payment instruments use the same format. Gift cards, loyalty cards, and some prepaid products reuse the 16-digit Luhn structure and brand prefixes. Passing validation here does not guarantee a card is a payment instrument.
- Co-branded cards may have a mismatch. A card physically branded Mastercard may be issued under a Visa prefix (or vice versa). This tool detects the canonical issuer prefix, not the printed logo.
- International variation. Some regions or issuer types use non-standard lengths or prefixes. The tool covers the major global brands; regional variants may fail detection even if structurally valid.