Format Code Now
/
Calculators & unitsCredit Card Number Validator Next: CLB to IELTS Converter ›

Credit Card Number Validator

CU-39

Paste card numbers, one per line, to check the Luhn checksum, the length and the issuer. A pass means the number is well formed. It does not prove a card exists.

Runs in your browser. Nothing is uploaded.

Card numbers, one per line

Result

How to use it

  1. Paste one card number per line. Spaces, dashes and dots are ignored.
  2. Leave Card type on Detect, or pick a type to test the number against it.
  3. Tick Mask digits if you do not want the full number repeated in the result.
  4. Click Validate and read the result line for each number.

What a pass means

Every number is cleaned of spaces, dashes and dots, must be 12 to 19 digits, and must pass the Luhn checksum, the formula that catches mistyped digits. The leading digits and the length are then compared with common issuer ranges. A pass means the number could be a real card number. It does not mean the card exists, is open or has funds. Only the payment processor can confirm that, and this page never contacts one.

Issuers it recognizes

Detection covers American Express, Diners Club, JCB, Mir, Mastercard, Visa, Discover, UnionPay and Maestro, using public prefix and length ranges. Where ranges overlap, the first match in that order wins. The ranges can go out of date as issuers add new ones, and a number outside every range is shown as an unknown issuer. If you pick a card type, the number is tested against that type only.

Handling real numbers

Nothing is sent anywhere, but you should still avoid pasting real card numbers into any page you do not control. For testing, use the numbers payment providers publish for that purpose; the sample lines are of that kind. The mask option shows only the first 6 and last 4 digits in the result, which is useful when you copy output into a ticket or a log.

Questions people ask

How does the Luhn algorithm work?

Starting from the right, every second digit is doubled, and if the result is over 9, 9 is subtracted. All digits are then added up. If the total ends in 0, the number passes. It catches single-digit typos and most swapped neighbors, but it is not a security check.

Does a valid result mean the card is real?

No. It means the number is well formed: right length, a known prefix and a correct checksum. Anyone can generate numbers that pass. Whether a card exists or has funds can only be learned from the card issuer through a payment processor.

Which card types does it detect?

American Express, Diners Club, JCB, Mir, Mastercard, Visa, Discover, UnionPay and Maestro. Detection uses the leading digits and the length. Issuers add ranges over time, so a newer card can show as an unknown issuer even when the checksum passes.

Why does a number fail the length check?

Each issuer uses set lengths. American Express uses 15 digits, Mastercard 16, and Visa 13, 16 or 19. A number with the right prefix but another length is reported with the lengths that issuer uses. Any number outside 12 to 19 digits fails for every type.

Can I check many numbers at once?

Yes. Put one number per line, up to 5000 lines. Each line gets its own result, and a count of how many passed is shown at the bottom. Lines with letters or symbols are reported as invalid with the offending character.

What test card numbers can I use?

Payment providers publish test numbers, such as 4111 1111 1111 1111 for Visa and 5555 5555 5555 4444 for Mastercard. They pass the Luhn check but are not real accounts. Use the provider's own list for the exact numbers that work in its test mode.

About this tool

Removes spaces, dashes and dots, checks that what is left is 12 to 19 digits, runs the Luhn checksum, and compares the leading digits and length with common issuer ranges. A pass only means the number is well formed. It does not mean the card exists, is active or has funds; only a payment processor can tell you that. The issuer ranges are public prefix lists and can be out of date, and a number that fits no range is reported as an unknown issuer. Checking a card type tests the number against that type only. Nothing here asks for an expiry date or security code, and you should not paste real card numbers into any tool you do not control. The sample lines are well-known test numbers.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.