Most credit cards have 16 digits, but the number varies by card type and issuer

A credit card number is not always 16 digits long. American Express cards have 15 digits. Diners Club and Carte Blanche cards have 14 digits. Visa, Mastercard, and Discover cards typically have 16 digits, though some Visa cards issued outside the United States may have 13 digits. The length depends on which company issued the card and which payment network it runs on.

The digits themselves are not random. Each position in the number carries specific information about the card, the bank that issued it, and the account holder. Understanding this structure helps you spot errors when you enter your card number online or over the phone, and it explains why a card number cannot simply be any combination of numbers.

The card number is formally called the Primary Account Number, or PAN. It appears on the front of your card and is the number you use to make purchases. It is different from your PIN (Personal Identification Number), which you enter at an ATM or point-of-sale terminal.

Key Takeaways

  • Visa, Mastercard, and Discover cards have 16 digits; American Express has 15; Diners Club has 14.
  • The first digit identifies the payment network (4 for Visa, 5 for Mastercard, 3 for American Express, 6 for Discover).
  • The first six digits together form the Bank Identification Number, which tells you which bank issued the card.
  • The last digit is a check digit calculated using the Luhn algorithm, which helps detect typos and fraud.
  • The middle digits identify your specific account and are unique to you within that bank.

What the first digit tells you about your card network

The very first digit of your card number is the Major Industry Identifier, or MII. This single digit tells you which payment network issued the card. Visa cards always start with 4. Mastercard cards always start with 5. American Express cards start with 3. Discover cards start with 6. Diners Club cards start with 3 or 5, depending on the specific card type.

This is why you cannot have a valid Visa card that starts with 5, or a valid Mastercard that starts with 4. The payment network is baked into the first digit. If you are entering a card number online and the website rejects it because the first digit does not match the card type you selected, the number you entered is either wrong or not actually issued by that network.

The first six digits make up your bank's identification number

The first six digits of your card number together form the Bank Identification Number, or BIN. This number identifies the specific bank or financial institution that issued your card. The first digit (the MII) is part of the BIN, but the BIN includes five more digits after it.

When you make a purchase, the merchant's payment processor uses the BIN to route your transaction to the correct bank. The BIN tells the processor which bank to contact, which network to use, and what type of card it is (credit, debit, prepaid, and so on). This is why the first six digits matter for processing — they are the address that tells the payment system where your card came from.

You can look up a BIN online using a BIN lookup tool to see which bank issued a particular card number range. This is useful if you want to verify that a card you received actually came from the bank you think it did, or if you are troubleshooting a declined transaction.

The middle digits are your account number

After the first six digits (the BIN), the next several digits are your account number. This is the part of the card number that is unique to you. The account number typically runs from digit 7 through digit 15 on a 16-digit card, though the exact position varies slightly by issuer.

Your account number is what ties the card to your specific bank account or credit line. Two people with cards from the same bank will have the same first six digits (the BIN) but completely different account numbers. The account number is what the bank uses to look up your balance, your transaction history, and your account settings when you swipe or insert your card.

The last digit is a check digit that catches errors

The final digit on your credit card is called the check digit. It is calculated using a mathematical formula called the Luhn algorithm, which was invented in 1954 by Hans Peter Luhn, an IBM scientist. The check digit is not random — it is derived from all the other digits on the card.

Here is how it works: the Luhn algorithm takes all the digits except the check digit, performs a series of multiplications and additions on them, and produces a single digit that should be added to the end. If you type in a credit card number and make a mistake in any of the earlier digits, the check digit will not match what the algorithm calculates, and the card will be rejected as invalid.

This catches most typos before your transaction is even sent to the bank. If you accidentally swap two digits, or type a 7 instead of a 1, the check digit will not line up and the payment processor will reject the card immediately. The check digit does not prevent fraud — a criminal with a stolen card number will have the correct check digit — but it does prevent accidental errors from wasting time and causing confusion.

Why card length varies by network and issuer

The reason different card types have different lengths comes down to how many account numbers each network needs to support. American Express chose to use 15 digits because it issues fewer cards than Visa or Mastercard and does not need as many possible account numbers. Diners Club uses 14 digits for the same reason.

Visa and Mastercard, which process far more transactions globally, use 16 digits to have enough room for billions of unique account numbers. The extra digits give them more combinations to work with, so they can issue more cards without running out of available numbers.

Within each network, individual banks may also issue cards with slightly different lengths. Some Visa cards issued in certain countries have 13 digits instead of 16. Some business cards or specialty cards may have different structures. But for the vast majority of cards you will encounter in the United States, the length follows the pattern: 15 for American Express, 14 for Diners Club, and 16 for Visa, Mastercard, and Discover.

How to verify your card number is valid

If you want to check whether a card number is mathematically valid without actually processing a transaction, you can run it through the Luhn algorithm yourself or use an online Luhn checker. These tools will tell you whether the check digit is correct for the digits you entered. A valid result means the number follows the correct structure; it does not mean the card is real, active, or has money on it.

When you enter your card number on a website, the website's payment form usually validates the number using the Luhn algorithm before sending it to the payment processor. This is why some websites will reject your card number immediately if you type it in wrong — they are checking the math, not contacting your bank.

If a website accepts your card number but the transaction is declined, the problem is not the structure of the number — it is something else, like insufficient funds, a fraud hold, or an address mismatch. The Luhn check only catches structural errors, not account problems.

Frequently Asked Questions

Can a credit card number be any length, or does it have to be a specific number of digits?

Credit card numbers must be a specific length depending on the card network. Visa, Mastercard, and Discover are 16 digits; American Express is 15; Diners Club is 14. A number that does not match these lengths is either invalid or from a card network you do not commonly see in the United States. The payment processor will reject it.

What does the first digit of a credit card number mean?

The first digit is the Major Industry Identifier. It tells you the payment network: 4 for Visa, 5 for Mastercard, 3 for American Express, 6 for Discover. You cannot have a valid Visa card starting with any other digit.

If I type in my credit card number wrong, will the payment go through?

Most likely not. The payment processor checks the card number using the Luhn algorithm before sending it to your bank. If you mistype a digit, the check digit will not match, and the form will reject the number as invalid. Even if the form does not catch it, your bank will decline the transaction because the account number will not match any real account.

Why does American Express have 15 digits instead of 16?

American Express chose 15 digits because it issues fewer cards than Visa or Mastercard and does not need as many possible account numbers. The shorter length is enough to support all American Express cardholders. It is not a security difference — just a choice based on the size of the network.

Is the check digit the same as my PIN or security code?

No. The check digit is the last digit of your card number and is visible on the card. Your PIN is a separate number you create and keep private. Your CVV or security code (the three or four digits on the back of your card) is also separate from the check digit. All three serve different purposes.