Credit Card Validator: Free Luhn Number Check

Credit Card Validator

Validate any credit card number using the Luhn algorithm and identify the card type, issuer, and account details.

Example Test Numbers

A credit card validator checks whether a card number follows the structure real card numbers use. This free tool runs the Luhn check, identifies the card network, and shows the Major Industry Identifier, so developers, testers and curious users can spot typos and malformed numbers in seconds.

What Is Credit Card Number Validation?

Credit card number validation is a format check that confirms a number is built the way card issuers build them. It does not contact a bank or confirm that an account exists. It only tests the digits themselves.

Every card number has three parts. The first digit is the Major Industry Identifier (MII), which says what kind of organization issued the card. The first six or so digits form the Issuer Identification Number (IIN), which points to the card network and the issuing institution. The remaining digits are the personal account number, and the very last digit is a check digit that makes the whole number pass a math test called the Luhn algorithm.

Why a format check is still useful

Most mistakes people make when typing a card number are single wrong digits or swapped neighbors. The Luhn check catches nearly all of those, so a failed result tells you to re-read the number before you do anything else with it.

How Does the Luhn Algorithm Work?

The Luhn algorithm adds up the digits of a number in a specific way and checks whether the total ends in zero. It was designed to catch accidental typing errors, not to stop fraud.

  1. Start at the rightmost digit (the check digit) and move left.
  2. Leave the check digit alone, then double every second digit going left.
  3. If doubling gives a two-digit result, subtract 9 from it (for example, 7 doubled is 14, and 14 minus 9 is 5).
  4. Add all the digits together.
  5. If the total divides evenly by 10, the number passes.

Because the check digit is chosen to make the total land on a multiple of 10, a number with one wrong digit will almost always produce a different total and fail.

How to Use the Credit Card Validator

You can validate a credit card number in a few seconds with the field and buttons on this page.

  1. Click the Credit Card Number field and type or paste the number. Spaces are added in groups of four as you type, and anything that is not a digit is dropped.
  2. Watch the network logos above the field. As soon as the first digits match a known pattern, the other logos dim so you can see which network the number looks like.
  3. Press Validate Card or hit Enter.
  4. Read the status banner, which reads Valid Card Number or Invalid Card Number, then scroll through the Validation Details: Luhn Algorithm Check, Issuer Identification (IIN), Major Industry Identifier (MII) and Personal Account Number (PAN).
  5. Click Copy Results to save the output, or Validate Another to start over.

If you only want to try the tool, use the buttons under Example Test Numbers: Visa, Mastercard, American Express, Discover, JCB and Diners Club. Each one fills the field with a well-known sample number.

Worked Example: Checking 4111 1111 1111 1111

Take the Visa sample number 4111 1111 1111 1111. It has 16 digits and starts with 4, so the tool reads it as a Visa and shows Banking and Financial as the MII.

For the Luhn check, you double every second digit from the right. The leftmost 4 becomes 8, and the seven doubled 1s each become 2, which gives 8 + 14 = 22. The eight digits that are not doubled are all 1s, so they add 8. The grand total is 30, which divides evenly by 10, so the number passes.

Now change the last digit and enter 4111 1111 1111 1112. The total becomes 31, so the Luhn row fails and the banner switches to Invalid Card Number. The network guess is still Visa, because the beginning and the length have not changed. Only the check digit is wrong, which is exactly what a typo looks like.

How Do You Read the Validation Results?

The results panel gives you a pass or fail on the Luhn check plus three facts about the structure of the number. Each row answers a different question.

Status banner and Luhn row

A green Valid Card Number banner means the digits passed the Luhn check. A red Invalid Card Number banner means they failed. If you see red, compare the number against the card digit by digit, look for swapped pairs such as 45 typed as 54, and try again.

Issuer Identification (IIN)

This row names the card network the number matches. The tool recognizes the ranges below. A number outside them is reported with an Unknown type, even when the Luhn check passes.

NetworkStarts withDigits
Visa413 or 16
Mastercard51 to 5516
American Express34 or 3715
Discover6011 or 6516
JCB35 (also 2131, 1800)16 (15 for 2131, 1800)
Diners Club300 to 305, 36, 3814

Newer Mastercard numbers that begin with 2 are not in the list above, so they may show as Unknown here even though they are real.

Major Industry Identifier (MII)

The MII is read from the first digit alone. For example, 3 means Travel and Entertainment, 4 and 5 mean Banking and Financial, 6 means Merchandising and Banking, and 1 and 2 mean Airlines. Most cards you handle will start with 3, 4, 5 or 6.

Personal Account Number (PAN)

The PAN row describes the account portion of the number, the part that identifies the individual cardholder account inside the issuer's range. It is informational and tells you nothing about who owns the card.

Who Uses a Credit Card Validator?

A credit card validator is most useful when you need to confirm a number is well formed without any link to a real account.

  • Developers and QA testers check that a checkout form accepts good numbers and rejects bad ones. Pair it with the credit card generator to create test numbers in valid format.
  • Support and data-entry teams catch typos before a payment attempt fails, which saves a back-and-forth with the customer.
  • Students learning checksums can enter a number, change one digit, and watch the result flip, which makes the Luhn algorithm easy to understand.
  • Analysts cleaning records can quickly see which sample entries are malformed. For contact lists, the bulk email validator does a similar cleanup job for addresses.

The same check-digit idea appears elsewhere. Product codes such as EAN-13 end in a check digit too, and you can see them in action with the barcode generator.

Best Practices and Common Mistakes

Most confusing results come from the input rather than the tool, so check these points first.

  • Too short. Fewer than 10 digits triggers a message that the number is too short. Re-check the full number, since most cards have between 13 and 16 digits.
  • Empty field. Pressing Validate Card with nothing typed asks you to enter a number.
  • Pasted text with extra characters. Dashes, spaces and letters are stripped, but a stray digit from a label or a date will change the number and make it fail.
  • Number cut off. The field holds 19 characters including spaces, which fits a 16-digit card typed in groups of four. A longer number will be truncated, so a failed result may just mean part of it was lost.
  • Expecting a CVV or expiry check. This tool does not take an expiry date or security code. It validates the card number only.
  • Using a real card for testing. For demos, tutorials and form testing, use the sample numbers on the page instead of your own card.

What a Valid Result Does Not Tell You

A valid result means the number is structurally correct, and nothing more. It does not mean the card has been issued, is active, has available credit, or belongs to a particular person.

A made-up number has roughly a one in ten chance of passing the Luhn check by luck, so a pass is not proof of authenticity. This tool also cannot look up a balance, credit limit, statement, reward points or application status. For any of those, sign in to your issuer's app or website, or call the number on the back of the card.

The identified network and MII are based on number patterns, not on a live lookup of the issuer, so treat them as a structural hint.

Check Your Card Number Now

If a number fails somewhere and you suspect a typo, this credit card validator gives you a clear answer in one click: pass or fail, plus the network and industry behind the digits. Enter your number or load one of the sample cards above, press Validate Card, and use the results to fix the input. You can find more utilities like it in the online calculators and utilities collection.

Frequently Asked Questions

How do you validate a credit card number?
You validate a credit card number by running the Luhn check on its digits. Type the number into the Credit Card Number field and press Validate Card. The tool shows a Valid or Invalid banner, plus the card network and Major Industry Identifier.
What does the Luhn algorithm check on a card number?
The Luhn algorithm checks that the digits add up to a multiple of 10 after doubling every second digit from the right. It is built to catch typing mistakes such as a wrong digit or two swapped digits, not to detect fraud.
Does a valid result mean the credit card is real or active?
No. A valid result only means the number is correctly formed. It does not confirm the card was issued, is active or has credit. The Credit Card Validator never contacts a bank, so only your card issuer can confirm account status.
Can this credit card validator check the expiry date or CVV?
No. The tool accepts only the card number. It has no fields for an expiry date or CVV, and it checks the number structure, card network and Major Industry Identifier. Contact the issuer to verify those details.
Why does my card number show as Invalid or Unknown?
An Invalid banner means the digits failed the Luhn check, usually from a typo, so re-enter the number carefully. An Unknown card type means the starting digits and length fall outside the supported networks, such as newer Mastercard numbers beginning with 2.
Is the credit card validator free, and which cards can it identify?
Yes, the Credit Card Validator is free and needs no sign-in. It identifies Visa, Mastercard, American Express, Discover, JCB and Diners Club numbers. You can try it with the sample numbers listed under Example Test Numbers.
Recommended

Explore VPN options

A VPN changes your network exit. It does not guarantee anonymity.

Hide Your IP Encryption Network coverage
Protect My IP Now