ToollyX
no sign-up · instant · free

Credit Card Validator

Check a card number's Luhn checksum and network format, batch-check a whole list, or generate synthetic test numbers for development — entirely offline, with no connection to any bank or card network.

CHECKLuhn (mod 10)
NETWORKS8 recognized
MODESSingle · Batch · Generate
PROCESSEDBrowser-local
728 × 90 — Leaderboard Ad
Try an example
Mask Number
Shows only the first and last groups — the rest as dots.
This checks mathematical formatting only (Luhn checksum, length, network prefix) — it cannot tell you if a card is real, active, or has funds. No network calls are made to any bank or card network.
↺ Clear
Validation Result
💳
Enter a card number — the result appears instantly as you type.
AlgorithmLuhn (mod 10)
Networks recognized8
Processed100% local, offline
728 × 90 — Leaderboard Ad

How to Check a Card Number

1Type or paste a number — spaces and dashes are ignored automatically, and the result updates as you type.
2Read the full breakdown, not just the verdict — Luhn, network, and length are checked and shown independently.
3Checking a whole list? Switch to Batch mode and paste one number per line for a summarized count.
4Need a number for a test form instead? Switch to Generate Test Numbers and pick a network.

Features

Detailed Luhn breakdown
Format, checksum, network, and length checked and shown as independent results, not one opaque verdict.
Offline network detection
8 major networks recognized entirely from published prefix ranges — no live BIN lookup, no network call.
Batch checking
Paste a whole list and get a per-line breakdown plus a valid/invalid/unrecognized summary.
Synthetic test number generator
Luhn-valid numbers for Visa, Mastercard, Amex and Discover, built for form and checkout testing.
Mask Number switch
Show only the identifying first and last groups when working somewhere your screen is visible.
Correct per-network grouping
Amex's 4-6-5 format and other networks' groupings are displayed the way real card forms show them.
Three-state verdicts
Valid, invalid, or "passes Luhn but unrecognized network" — not a false binary.
100% client-side
Every check and every generated number is computed in your browser. Nothing is ever transmitted.

What "Valid" Actually Means Here

This is worth stating plainly, because it's the one thing every visitor to a tool like this should understand before reading anything else: a card number passing every check on this page tells you it is correctly formatted — not that it belongs to a real account, that the account has funds, or that a charge against it would succeed. The Luhn checksum is a typo-catching mechanism built into the numbering scheme itself, not a fraud-prevention measure, and it requires no connection to any bank to verify — which is exactly why it can be computed instantly, offline, in a browser tab. Confirming whether a specific card is real, active, and authorized to charge requires an actual payment processor attempting an actual authorization — something no browser-based tool can or should simulate.

The Luhn Checksum, Worked Through

Starting from the rightmost digit and moving left, every second digit gets doubled; any doubled result over 9 has 9 subtracted from it (which is a shortcut for summing its own two digits — 16 becomes 1+6=7, the same as 16-9=7). Every digit in the number — doubled or not — then gets added together, and a genuine card number always produces a total divisible by 10. Take Visa's well-known public test number, 4242 4242 4242 4242: run the doubling and summation across all sixteen digits and the total lands on a clean multiple of 10, confirming the checksum. Change any single digit anywhere in that number and the sum almost never divides evenly again — which is the whole point: it catches a fat-fingered digit or a transposed pair before a request is even sent anywhere, without needing to check anything against a database.

728 × 90 — Leaderboard Ad

Reading Network Prefixes Without a Live Database

Card networks publish the numeric ranges — called IIN or BIN ranges — that identify which network issued a given number, precisely so that merchants' systems can route a transaction correctly before it even reaches a bank. Visa numbers begin with 4; American Express with 34 or 37; Mastercard occupies a defined band from 51 through 55 plus a newer 2221-2720 range added when the original block began running low. This tool matches against those publicly documented ranges directly, which correctly identifies the overwhelming majority of real-world cards without ever making a network request — the tradeoff is that a live BIN lookup service can additionally tell you the specific issuing bank and country, which requires querying an actual database this tool deliberately doesn't connect to.

Why Length and Grouping Differ From One Network to the Next

It's a common assumption that every card number is 16 digits arranged in four groups of four — Visa, Mastercard, Discover, JCB and UnionPay do follow that pattern, but American Express doesn't, and neither does Diners Club. Amex numbers are 15 digits, not 16, laid out as 4-6-5 rather than 4-4-4-4 — a difference baked into the network's original design decades ago, not an inconsistency in this tool. Diners Club runs shorter still, at 14 digits grouped 4-6-4. Maestro is the least uniform of all: it accepts anywhere from 12 to 19 digits, since it was designed as a flexible debit standard across many issuing banks rather than one fixed format.

This is exactly why the length check runs independently from the network check rather than assuming one fixed length for everything — a 16-digit number with an Amex-style prefix would be immediately wrong despite passing Luhn cleanly, and this tool reports that mismatch explicitly instead of silently accepting a length that doesn't actually belong to the network it detected. Getting the grouping right matters just as much for anything rendering a card number visually: a form that displays every card in 4-4-4-4 chunks regardless of network will split an Amex number in the wrong place, which is a small but real usability bug that shows up constantly in checkout UIs built without per-network formatting logic.

Why Generate Synthetic Test Numbers At All

Building or testing anything that accepts a card number — a checkout page, a billing form, a payment SDK integration — needs realistic input that won't accidentally trigger a real charge. Every major payment processor solves this by publishing their own official test numbers for exactly this purpose; this tool does the equivalent locally, constructing a number from a real network's prefix, filling the middle with random digits, and computing the one check digit that makes the Luhn math come out even. The result passes every format check a real card would, while corresponding to no actual funded account anywhere — safe to paste into a form's input field to confirm validation logic behaves correctly, and useless for attempting an actual purchase, which is exactly the balance a testing tool should strike.

Practical Uses for the Batch Mode

  • Cleaning up a test-data fixture: paste a list of numbers used across a test suite and confirm none of them have gone stale or been mistyped.
  • Auditing sample data before a demo: quickly confirm every placeholder number in a slide deck or documentation example is a genuinely valid test number, not an accidental real-looking one.
  • Teaching the Luhn algorithm: run a batch of known-good and deliberately-broken numbers side by side to show students exactly which check catches which kind of error.
  • QA regression checks: verify that a validation library correctly classifies a mixed batch of valid, invalid, and unusual-network numbers the same way this tool does.
Verified by ToollyX Team · Last updated July 2026

Where This Tool Stops

It cannot and does not check whether a number belongs to an open account, whether that account has available credit or funds, whether it's been reported stolen, or whether a specific merchant would accept it — none of that is determinable without an actual authorization request through a real payment network, which is precisely the kind of check this tool is built to avoid needing. If you're building real payment infrastructure, that verification belongs in your payment processor's sandbox environment, not a browser-based formatting tool. For generating strong credentials elsewhere in your stack, see Password Generator; for verifying data integrity more generally, see Hash Generator.

Frequently Asked Questions

728 × 90 — Leaderboard Ad