Credit Card Number Validator

Client-sideNo sign-upFree

Check a card number’s format with the Luhn checksum and detect its likely network.

How this tool works

1

Enter a card number

Spaces and hyphens are stripped automatically before checking.

2

The Luhn checksum runs

The same checksum formula every payment form uses to catch typos.

3

Network is detected

Visa, Mastercard, Amex, or Discover is identified from the prefix and length pattern.

4

Read the result - and the disclaimer

A pass means correctly formatted, not verified as a real, active, funded card.

Quick facts

Category
Validators
Best for
Catching a mistyped card number before submitting a form
⚠ This only checks that the number is formatted correctly and passes the Luhn checksum - it does not verify that the card is real, active, or has any funds. A number can pass this check and still belong to no real account.
Card number
✓ Passes Luhn checksum - detected network: Visa
In-content slot

About this tool

Paste a card number to check it against the Luhn algorithm - the checksum formula used by every major card network to catch typos and transcription errors - and see which network it’s formatted for (Visa, Mastercard, American Express, or Discover), detected purely from its leading digit pattern and length. This tool explicitly does not and cannot verify that a card is real, currently active, or has any available funds - that information only exists inside the issuing bank’s systems, which a browser-based tool has no way to reach. A card number can pass the Luhn checksum and match a network’s format perfectly while still belonging to no real account, having expired, or having been canceled; the checksum only proves the number wasn’t mistyped, the same check a payment form runs before ever contacting a bank. Never treat a passing result here as proof a card can actually be charged. Runs entirely client-side - card numbers are never transmitted anywhere.

Why use this tool

Same checksum as real payment forms

Uses the actual Luhn algorithm, the same first-line check every card processor runs.

Network detection included

Identifies Visa, Mastercard, Amex, or Discover from the number pattern, not just pass/fail.

Upfront about its limits

A visible warning makes clear this checks format only, not whether a card is real or funded.

Nothing ever transmitted

Card numbers are checked entirely in your browser and never sent anywhere.

Frequently asked questions

No - this only confirms the number is internally consistent according to the Luhn checksum formula and matches the digit-count and prefix pattern of a real network. Whether a card is actually issued, active, unexpired, and has funds available can only be confirmed by the issuing bank during an actual payment attempt, which is completely outside what a client-side format checker can do.

It works by doubling every second digit from the rightmost digit, subtracting 9 from any result over 9, then summing all the digits - a validly formatted card number always produces a sum divisible by 10. This specific arithmetic pattern is good at catching the most common typing mistakes, like transposing two adjacent digits or mistyping a single digit, which is why it’s built into card numbering rather than being an arbitrary rule.

Each network reserves a specific range of leading digits and a specific total length for its cards - Visa numbers start with 4, Mastercard with 51-55 or 2221-2720, American Express with 34 or 37, and Discover typically with 6011 or 65. The detector checks the input against these known prefix-and-length combinations; a number that doesn’t match any of them is reported as an unknown network rather than a guess.

Explore more free tools

Formatters, converters, validators, and generators - all free and running entirely in your browser.

Browse more tools