Advertisement

IIN + length + Luhn check · runs locally

Credit Card Validator

Paste a credit or debit card number to verify its format: brand (IIN), length and Luhn checksum, each step explained. Add the expiry date (MM/YY) to check it is not past, and the CVV to check its length fits the brand (3 digits, 4 for Amex). Everything runs in your browser — nothing is sent or stored.

Advertisement

Runs in your browser · IIN, length & Luhn · nothing stored

Try:

Need numbers to test with? Generate test cards.

Advertisement

Checked locally in your browser — the number is never sent anywhere.

What the validator checks

A card number can be checked for three things without contacting a bank. The validator runs all three and shows the result of each:

  1. Issuer (IIN) range. The first digits identify the card network: 4 for Visa, 51–55 or 2221–2720 for Mastercard, 34 or 37 for American Express, 6011, 644–649 and 65 for Discover (622126–622925 are UnionPay co-branded cards also routed as Discover), 3528–3589 for JCB, and so on.
  2. Length. Each brand allows specific lengths — 15 digits for Amex, 14 for most Diners Club cards, 16 for most others, and up to 19 for some Visa, Discover, JCB, UnionPay and Maestro cards.
  3. Luhn checksum. The last digit is a check digit. The Luhn formula catches any single mistyped digit and most swaps of two neighbouring digits (it misses 09 ↔ 90).

If all three pass, the number is well-formed. That is all any website can know on its own: whether the account exists, is open, and has funds is only known to the issuing bank and is checked when a payment is authorized.

Can you check a CVV online?

Only its format. The CVV is not calculated from the card number by any public formula, so a website can check just its length: 3 digits for Visa, Mastercard, Discover, JCB and most others, 4 digits for American Express. Type a code in the optional CVV field above to run that check. Whether a code matches the card is known only to the issuing bank and is checked during a payment authorization — tools that claim to "find" or "check live" CVVs are scams or fraud tools. More in CVV vs CVC vs CID.

Advertisement

Luhn algorithm, step by step

Here is the calculation for the test number 4111 1111 1111 1111. Every second digit from the right is doubled; when the double is greater than 9, 9 is subtracted. The values are added up:

Digit4111111111111111
Doubled?8–2–2–2–2–2–2–2–
Value added8121212121212121

The total is 30. Because 30 is divisible by 10, the number passes. If you change any single digit, the total changes and is no longer a multiple of 10 — try it in the validator above to see which check digit the edited number would need.

Card number structure

PartDigitsMeaning
Major Industry Identifier (MII)1stIndustry: 1–2 airlines, 3 travel & entertainment, 4–5 banking & finance, 6 merchandising & banking, 7 petroleum, 8 healthcare & telecom, 9 national assignment
Issuer Identification Number (IIN / BIN)First 6–8Network and issuing bank, card type (credit, debit, prepaid) and country
Account identifierMiddle digitsChosen by the issuer for the individual card
Check digitLastCalculated with the Luhn algorithm from all other digits

When to use a card validator

Frequently asked questions

Does a valid result mean the card is real?

No. The validator checks the format only. Whether an account exists, is active or has funds can only be confirmed by the issuing bank through a payment authorization.

Is it safe to paste a real card number here?

The check runs in JavaScript on your device and the number is never sent to our server. Still, as a habit, avoid pasting real card numbers into any website you do not need to.

What does the Luhn check detect?

It catches all single-digit typos and most swaps of two adjacent digits. That is why forms use it to give instant feedback before the payment is submitted.

Why is my number invalid?

Usually a typo: one wrong digit makes the Luhn sum fail. The validator shows which check digit the number would need, so you can see the difference.

Can this validator check if a CVV is correct?

No tool outside the issuing bank can. A website can only confirm the length — 3 digits, or 4 for American Express. The bank checks whether the code matches when a payment is authorized.

How do I get a valid credit card number?

A real, usable number only comes from a bank or card issuer that opens an account in your name; it cannot be generated. For testing, “valid” means format-valid: use the generator for Luhn-valid numbers, or your payment gateway’s official test cards in sandbox mode.

Related tools

Advertisement