Monday, February 22, 2016

Credit Card Number

Monday, February 22, 2016 Posted by Sandeep Kumar Jha

A credit card is a payment card issued to users (cardholders) as a method of payment. 

It allows the cardholder to pay for goods and services based on the holder's promise to pay for them.

The issuer of the card (usually a bank) creates a revolving account and grants a line of credit to the cardholder, from which the cardholder can borrow money for payment to a merchant or as a cash advance.


Visa and MasterCard are the two most prominent payment processors for credit cards.


Check your credit card number


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

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

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

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

  • Last 4 digit is Check Digit



How to validate a Credit Card Number?

Most credit card number can be validated using the Luhn algorithm, which is more or a less a glorified Modulo 10 formula!

The Luhn Formula:

Drop the last digit from the number. The last digit is what we want to check against

Reverse the numbers

Multiply the digits in odd positions (1, 3, 5, etc.) by 2 and subtract 9 to all any result higher than 9

Add all the numbers together

The check digit (the last number of the card) is the amount that you would need to add to get a multiple of 10 (Modulo 10)

Luhn Example:

Step Total
Original Number: 4 5 5 6 7 3 7 5 8 6 8 9 9 8 5 5
Drop the last digit: 4 5 5 6 7 3 7 5 8 6 8 9 9 8 5
Reverse the digits: 5 8 9 9 8 6 8 5 7 3 7 6 5 5 4
Multiple odd digits by 2: 10 8 18 9 16 6 16 5 14 3 14 6 10 5 8
Subtract 9 to numbers over 9: 1 8 9 9 7 6 7 5 5 3 5 6 1 5 8
Add all numbers: 1 8 9 9 7 6 7 5 5 3 5 6 1 5 8 85
Mod 10: 85 modulo 10 = 5 (last digit of card)


Credit Card Type
Credit Card Number
American Express
378282246310005
American Express
371449635398431
American Express Corporate
378734493671000
Australian BankCard
5610591081018250
Diners Club
30569309025904
Diners Club
38520000023237
Discover
6011111111111117
Discover
6011000990139424
JCB
3530111333300000
JCB
3566002020360505
MasterCard
5555555555554444
MasterCard
5105105105105100
Visa
4111111111111111
Visa
4012888888881881
Visa
4222222222222
Note : Even though this number has a different character count than the other test numbers, it is the correct and functional number.
Processor-specific Cards
Dankort (PBS)
76009244561
Dankort (PBS)
5019717010103742
Switch/Solo (Paymentech)
6331101999990016