Validate Credit Card Numbers

  • Visa
  • Mastercard
  • American Express
  • Discover
  • JCB
  • Diners Club

Luhn Algorithm Check

We'll check your number against the Luhn Algorithm to see if it is a valid credit card number.

The credit card number you entered passed the Luhn Check and is therefore a valid credit card number!

The credit card number you entered failed the Luhn Check. It's not valid, did you make a typo?

Major Industry Identifier

The first digit of a credit card number represent the category of entity which issued the card.

Issuer identification number

The first six digits of a card number identify the institution that issued the card to the card holder.

Personal Account Number

Digits 7 to final number minus 1 (the last is the checksum) indicate the individual account identifier.

Luhn's Proof

Let us illustrate how we validate a credit card using Luhn’s formula with an interactive example.

We have noticed that you have not tried to validate any credit card number yet. We’ll demonstrate the entire process using a test number, 4929717681432141 and applying the Luhn’s formula.

1. Drop the check digit
1
2. Account number
492971768143214
3. Double every other digit
894914114616183418
4. Add up the digits
8 + 9 + 4 + 9 + 5 + 1 + 5 + 6 + 7 + 1 + 8 + 3 + 4 + 1 + 8 = 79

The check digit is obtained by computing the sum of digits then computing 9 times that value modulo 10 (so that's: (79 * 9 mod 10)). In summary:

  1. Compute the sum of the digits (79).
  2. Multiply by 9 (711).
  3. Take the last digit (1).
  4. The result is your check digit.

Significance of First Digit

Many people do not know this as a fact that the left most digit of the card is very important. In the table below, we have outlined the meaning of this number in principal.

First Card Digit Industry Category
0ISO/TC 68 and Other Industry Assignments
1Airlines
2Airlines and Other Industry Assignments
3Travel and Entertainment
4Banking and Financial
5Banking and Financial
6Merchandising and Banking
7Petroleum
8Telecommunications and Other Industry Assignments
9National Assignment

Credit Card Break Down by Issuer

Credit card companies generate their list of card numbers as per a pre- allotted set of pre-fixes. These pre- fixes are much like area codes of a phone number where the first 3 digits of a phone number tell you the area code of that state or province. Similar concept is used in credit card pre-fix numbers.

Card Digits Security / Length Card Prefix
American Express 15 CID / 4 34, 37
Diners Club - Carte Blanche 14 CVV / 3 300, 301, 302, 303, 304, 305
Diners Club - International 14 CVV / 3 36, 38
Diners Club - USA & Canada 16 CVV / 3 54
Discover 16 CID / 3 6011, 644, 645, 646, 647, 647, 649, 65
enRoute 15 CVV / 3 2014, 2149
InstaPayment 16 CVV / 3 637, 638, 639
JCB Co Inc (15 digit) 15 CVV / 3 1800, 2100
JCB Co Inc (16 digit) 16 CVV / 3 3088, 3096, 3112, 3158, 3337, 3528
Laser (16 digit) 16 CVV / 3 6304, 6706, 6709, 6771
Laser (17 digit) 17 CVV / 3 6304, 6706, 6709, 6771
Laser (18 digit) 18 CVV / 3 6304, 6706, 6709, 6771
Laser (19 digit) 19 CVV / 3 6304, 6706, 6709, 6771
MasterCard 16 CVC2 / 3 51, 52, 53, 54, 55
Visa (13 digit) 13 CVV2 / 3 4, 40240071, 4485, 4532, 4539, 4556, 4716, 4916, 4929
Visa (16 digit) 16 CVV2 / 3 4, 40240071, 4485, 4532, 4539, 4556, 4716, 4916, 4929
Visa Electron 16 CVV / 3 4026, 417500, 4508, 4844, 4913, 4917
Voyager 15 CVV / 3 8699
It is main inner container footer text