Card Number Validator

Type a card number with or without spaces. The page checks the length, the Luhn check digit and the card network from the leading digits, and shows each step. Nothing you type leaves your browser.

Free Runs in your browser Checked Tuesday, November 10, 2026

Digits only; spaces and dashes are ignored. Use a published test number, never a real card.

Result

Result — Green when the length and the check digit are right.
Network — Read from the first digits. Not recognised means no range on this page matches.

Steps

This tool runs in your browser. What you enter is not sent to us.

How to use it

  1. Type the number in the Card number field, with or without spaces.
  2. Read Result: green means the length and the Luhn check digit are right.
  3. Read Network to see the card brand the leading digits suggest.
  4. For testing, use the numbers published by a payment provider, such as the Stripe test numbers in the sources below.

How the Luhn check works

The last digit of a card number is a check digit. The Luhn method, which ISO/IEC 7812-1 uses for card numbers, works from the right: every second digit is doubled, and a doubled result above 9 has 9 taken off. The total of all digits must be a multiple of 10.

total = sum of the digits, with every second digit from the right doubled (minus 9 if above 9)
valid when total mod 10 = 0
  • The Luhn check finds typing mistakes such as a changed digit; it cannot tell whether an account exists or has money on it.
  • Spaces and dashes are removed before the check, so they do not change the result.

Networks from the leading digits

The first digits of a card (the issuer identification number, IIN) show the network. This page uses the public IIN table of Wikipedia's "Payment card number" article, with two additions from network pages: Troy's brand guidelines (sample numbers that start with 9792) and American Express's merchant page (34 and 37).

The ranges are: Visa 4; Mastercard 51 to 55 and 2221 to 2720; American Express 34 and 37; Discover 6011, 644 to 649, 65 and 622126 to 622925; JCB 3528 to 3589; UnionPay 62; Diners Club 30, 36, 38 and 39; Maestro 5018, 5020, 5038, 5893, 6304, 6759, 6761 to 6763, 676770 and 676774; Mir 2200 to 2204; RuPay 60, 65, 81, 82 and 508; Troy 9792. A number whose start is not listed shows as not recognised.

The length follows each network's row in the table: Visa 13, 16 or 19; Mastercard 16; American Express 15; Discover, JCB and UnionPay 16 to 19; Diners Club 14 to 19; Maestro 12 to 19; Mir 16 to 19; RuPay 16; Troy 16. A number of unknown network is checked for 8 to 19 digits, the range the article gives for card numbers.

Test numbers and real cards

Payment providers publish test card numbers that look real to a checker but move no money. Stripe lists them for each brand on its testing page, for example 4242 4242 4242 4242 for Visa and 3056 9300 0902 0004 for Diners Club.

This page keeps everything in your browser and sends nothing. Still, type only a test number here: a real card number is a secret, and no check is needed for a card you own.

Example: 4242 4242 4242 4242

The number has 16 digits and starts with 4, so the network is Visa. Counting from the right, every second digit is a 4, and each is doubled to 8: 8 × 8 = 64. The 2s in the other positions add 2 × 8 = 16.

The total is 64 + 16 = 80. It is a multiple of 10, so the Luhn check passes and the number is valid in format.

Part Digits Total
Doubled (every second digit from the right) 4 × 8, each doubled to 8 64
Not doubled 2 × 8 16
Sum 80, a multiple of 10

Frequently asked questions

Is it safe to type my card number into this page?

The page works in your browser and sends nothing, but the safe habit is to type only a published test number. Never type a real card number into a site you do not trust.

Does a valid card number mean the card works?

No. The check only confirms that the number is well formed. It does not confirm that the card exists, is active, or has funds, which only the card issuer can say.

Where can I find test card numbers?

Stripe publishes test card numbers for each brand on its testing page, and the sources below list them. Those numbers are for testing only and do not move money.

Why is Troy shown only for numbers starting with 9792?

Troy's brand sample numbers start with 9792. The public IIN table gives 65 to both Discover and RuPay, so this page reads 65 as Discover, not Troy.

What does not recognised mean?

The leading digits do not match any range on this page. The card may still be valid, from a network or range this page does not list.

Does the page keep the number I type?

No. The number is checked in your browser and is not stored or sent to anyone.

Sources

Figures and text last checked on Tuesday, November 10, 2026.

We use necessary cookies to run the site. With your consent, Google also uses advertising cookies to show personalised ads. If you reject them, you still see ads, but they are not personalised.