GALAXY OF TOOLS

SECURITY SECTOR

Credit Card Validator

Check whether a card number passes the Luhn test and detect Visa, Mastercard, Amex, RuPay and more — offline.

Spaces and dashes are ignored. Only the number is needed — never enter your CVV or expiry here or anywhere you don’t trust.
—Enter a card number to check it.
Test numbers for developers
Test numbers pass the checksum but are not linked to any account and cannot be charged. Use them only in sandbox/test modes.

Validation runs entirely in your browser. The number you type is never sent anywhere or stored. This tool never asks for the expiry date, CVV or name.

Credit card validator: Luhn check and network detection

This credit card validator tells you in real time whether a card number is well-formed: it runs the Luhn algorithm (the mod-10 checksum every major card network uses), identifies the network from the first digits — Visa, Mastercard (including the newer 2-series), American Express, Discover, RuPay, Diners Club, JCB, UnionPay, Maestro and Mir — and checks that the length is right for that network. The number is formatted as you type, Amex-style 4-6-5 included.

It is built for developers testing checkout forms, support staff checking a number read over the phone, and anyone who wants to understand why a payment form says “invalid card number”. Everything runs in your browser: the number is never transmitted or saved, and the tool never asks for a CVV, expiry date or cardholder name — details no validator needs.

How to use the Credit Card Validator

  1. Type or paste the card number. Spaces and dashes are fine; the field groups the digits automatically.
  2. Read the verdict: “Valid format” when the Luhn check, network prefix and length all agree, or a specific reason when they do not.
  3. Check the breakdown for the network, region, IIN/BIN, length rules and the masked form, and scroll to the Luhn table to see the arithmetic.
  4. For testing a payment form, choose a network and press “Use a well-known test number” or “Generate a random Luhn-valid number”.

Credit Card Validator features

Luhn checksum shown step by step

Every digit, the doubling, the subtraction of 9 and the final sum are laid out so you can follow or teach the algorithm.

Ten card networks

IIN ranges for Visa, Mastercard 51–55 and 2221–2720, Amex, Discover, RuPay, Diners Club, JCB, UnionPay, Maestro and Mir, with the correct length for each.

Formats as you type

Groups of 4 for most cards, 4-6-5 for American Express and 4-6-4 for 14-digit Diners Club numbers.

Test numbers for developers

The well-known sandbox numbers published by payment processors, or freshly generated Luhn-valid numbers with the right prefix and length.

Private and offline

No network requests, no storage, and no request for CVV or expiry.

How the Luhn algorithm works, step by step

Example with 4539 1488 0343 6467: doubling every second digit from the right (4→8, 3→6, 1→2, 8→16→7, and so on) and subtracting 9 where needed turns the digits into 8 5 6 9 2 4 7 8 0 3 8 3 3 4 3 7, which sum to 80, which is divisible by 10, so the number is valid. Change one digit and the sum lands on a non-multiple of 10. The check catches every single-digit typo and almost every swap of two adjacent digits (only 09↔90 slips through).

Luhn is a typo detector, not a security feature: it is public and easy to satisfy, which is exactly why test numbers are easy to make.

  1. Starting from the right-most digit (the check digit) and moving left, double every second digit.
  2. If doubling gives a number above 9, subtract 9 (equivalently, add the two digits together).
  3. Add up all the digits — the doubled ones and the untouched ones.
  4. If the total is a multiple of 10, the number passes.

Card number structure and network prefixes

A card number (PAN) has three parts: the issuer identification number (IIN or BIN, the first 6 — now 8 — digits, which identify the network and the bank), the account identifier, and the final Luhn check digit. The first digit is the major industry identifier: 3 for travel and entertainment (Amex, Diners, JCB), 4 and 5 for banking (Visa, Mastercard), 6 for merchandising and banking (Discover, RuPay, UnionPay, Maestro).

NetworkStarts withLength
Visa413, 16 or 19
Mastercard51–55, 2221–272016
American Express34, 3715
Discover6011, 644–649, 6516–19
RuPay60 (except 6011), 6521, 6522, 81, 82, 50816
Diners Club300–305, 3095, 36, 38, 3914–19
JCB3528–358916–19
UnionPay6216–19
Maestro50, 56–69 (where not claimed above)12–19
Mir2200–220416–19

What “valid” does and does not mean

  • A valid format means the number could exist. Only the issuing bank can confirm that the card is real, active, not reported stolen and has credit available — that happens during an authorisation, never in a validator.
  • The test numbers here (such as 4111 1111 1111 1111 or 5555 5555 5555 4444) are published by payment processors for sandbox use. They pass Luhn but cannot be charged; using them on a live checkout simply fails.
  • Never paste a real card number into a site you do not trust, and never share the CVV — it is the one part designed not to be stored anywhere.
  • For bank account numbers rather than cards, use the IBAN Validator; for form input checks on addresses, try the Email Validator.

Credit Card Validator FAQ

Is it safe to enter my credit card number here?

The number stays in your browser — there is no network request and nothing is stored. Still, the safest habit is to use this with test numbers or a number you are checking for a typo, and never to enter the CVV or expiry anywhere that does not need them.

Can a credit card validator tell me if a card is real or has money?

No. It can only confirm the number is well-formed: correct checksum, known network prefix and valid length. Whether an account exists and has funds is known only to the issuing bank at authorisation time.

Why does my card show as “Unknown network”?

Either the first digits were mistyped, or the card is from a small regional scheme not in the list. The Luhn result is still meaningful on its own.

What are the test credit card numbers for developers?

Common ones are Visa 4111 1111 1111 1111 and 4242 4242 4242 4242, Mastercard 5555 5555 5555 4444 and 2223 0031 2200 3222, Amex 3782 822463 10005, Discover 6011 1111 1111 1117, JCB 3530 1113 3330 0000 and Diners 3056 9309 0259 04. Your payment provider’s sandbox documentation lists the ones it accepts.

Does RuPay use the Luhn algorithm too?

Yes. RuPay, India’s domestic network run by NPCI, issues 16-digit numbers with a Luhn check digit, with prefixes such as 60, 65, 81, 82 and 508. NPCI does not publish public test numbers, so this tool generates Luhn-valid RuPay-prefixed numbers for sandbox use.

Why do Mastercard numbers sometimes start with 2?

Mastercard added the 2221–2720 range in 2017 because the 51–55 range was running out. Payment forms that only accept “5” prefixes are out of date and will wrongly reject these cards.

You might also need