What does a credit card number validator check?
A card number validator answers one narrow question: is this string well formed as a card number? It checks the Luhn checksum that most schemes use, the length the scheme allows, and whether the leading digits, the issuer identification number, belong to a scheme the tool knows. It does not contact a bank, look up an account or say whether a card can be charged, and it cannot — none of that is visible from the number alone.
The Luhn check is what catches the ordinary mistakes. Counting from the right, every second digit is doubled and its digits summed, and the total must be a multiple of ten. A digit typed twice, two adjacent digits swapped or one key pressed wrongly almost always break that total, so a failing checksum is strong evidence of a typo. A passing checksum is much weaker evidence: a randomly chosen number of the right length has about a one in ten chance of passing by accident.
The scheme check adds a second filter. Each scheme fixes a prefix and a set of lengths, so Visa begins with four and can be 13, 16 or 19 digits, American Express is 15 and begins 34 or 37, and Mastercard is 16 digits in the 51 to 55 range or the newer 2221 to 2720 block. Requiring both the prefix and the length to agree is a stronger signal than either alone, and it is why a plausible number of the wrong length is flagged rather than passed.
How to validate a card number
- Paste the card number, or a list with one number per line for a batch check.
- Spaces, hyphens and dots are ignored, so a number can be pasted exactly as it was written.
- Read the verdict: well formed, or not valid, with the scheme and the digit count alongside.
- Look at the reasons when a number fails — a wrong length, an unknown prefix, repeated digits or a failed checksum.
- Turn on masking before sharing a screen if the digits should not be visible.
- Remember that a pass is a statement about the format, not about the account behind the number.
Credit Card Validator limits and rules
| Item | Limit |
|---|---|
| Checksum | The Luhn algorithm, applied from the right, as used by most card schemes |
| Length | 12 to 19 digits overall, and the specific lengths each scheme allows |
| Schemes | Visa, Mastercard, American Express, Discover, Diners Club, JCB, UnionPay and Maestro |
| Formatting | Spaces, hyphens and dots are stripped before checking |
| Batch | One number per line, each checked and reported separately |
| Privacy | Checked in the page; nothing is transmitted, stored or logged |
| Not covered | Whether the account exists, is open, has funds, or is accepted anywhere |
When to use it
- Catching a typo in a card number before a form is submitted and rejected.
- Checking that a test number produced by the generator is genuinely Luhn-valid.
- Identifying which scheme a number belongs to from its leading digits.
- Validating a batch of test numbers in a payment integration.
- Confirming a number's format when it is already in hand rather than guessed at.
Is it private?
The check runs entirely in this page. The number is never transmitted, stored or logged, and the network tab stays empty — which is why it is worth preferring a tool like this over one that sends a number to a server, even a number you own.
Frequently asked questions
No. It means the number is arithmetically consistent: the checksum matches, the length is right for the scheme and the prefix is a known one. A made-up number can satisfy all three, and a genuine number can fail none of them while still belonging to a closed, blocked or empty account. Whether a card works is known only to the issuer, and finding out means trying to charge it, which is a different act entirely.
It is a simple checksum designed to catch typing errors. Working from the rightmost digit, every second digit is doubled, and if the doubling produces a two-digit value its two digits are added together; all the digits are then summed and the total must be divisible by ten. It detects most single-digit mistakes and most transpositions of adjacent digits, which is exactly the family of errors a person makes when copying a number from a card.
Because the scheme its prefix points to does not allow that length. American Express numbers are 15 digits, most Mastercard numbers are 16, and Visa allows 13, 16 and 19. A 16-digit number beginning 34 is therefore inconsistent: either the length is wrong or the prefix is, and the tool reports both possibilities rather than accepting the number on the strength of its checksum alone.
Nothing is transmitted — the check runs in the page and the network tab stays empty — but the safe habit is not to type a real card number into any tool you do not control, including this one. If you own the number and want to check it, masking hides the middle digits in the results before you share a screen. If you are testing software, use the Credit Card Generator instead and never a real card.
Visa, Mastercard, American Express, Discover, Diners Club, JCB, UnionPay and Maestro, identified from the leading digits each one reserves. Where a prefix matches no scheme the number is reported as unknown rather than guessed at, and where two schemes overlap the more specific prefix wins. New ranges are added by issuers from time to time, so an unfamiliar prefix is a reason for caution rather than proof of a fake.
No, and neither can any offline tool. Balance, status, expiry and the cardholder's agreement are all held by the issuer and are not derivable from the number. Any service claiming otherwise is either guessing or asking you to send a real card number somewhere it should not go. This tool's limits are deliberate: it checks the format, and it says so plainly.
Related tools
Written and maintained by Md. Nur Hossain Repon.