Google Answers Logo
View Question
 
Q: credit card types ( Answered 5 out of 5 stars,   1 Comment )
Question  
Subject: credit card types
Category: Business and Money
Asked by: hagen-ga
List Price: $10.00
Posted: 07 Jul 2002 07:44 PDT
Expires: 06 Aug 2002 07:44 PDT
Question ID: 37279
The first one or two digits of a credit card shows what kind of card
it is. Can someone point to a list for this association for
Mastercard, Visa, Discover, American Express, Diners?
Answer  
Subject: Re: credit card types
Answered By: morris-ga on 07 Jul 2002 08:21 PDT
Rated:5 out of 5 stars
 
Hagen-ga,

Thanks for asking the question. I never noticed that card numbers were
coded that way until you asked. The answer for the first couple cards,

American Express - 34 and 37
Master Card - 51,52,53,54,55
Visa - 4 (just one digit)

Are from a BrainJar.com article by Brian Half on the subject of credit
card number Validation Algorithms.

http://www.brainjar.com/js/validation/default2.asp

The Discover, and especially the Diners Club were a little tougher to
turn up, but I found them in a couple Java Scripts for credit card
validation, such as the one at Internet.com.

Discover - 6011 (four digits)
Diners Club - 30,36 and 38

along with two more four-digit prefix cards I'd never heard of:

enRoute card - 2014, 2149 
JCB card - 3088,3096,3112,3158,3337,3528

http://javascript.internet.com/forms/val-credit-card.html

Then I thought I'd look for a Perl script, in case you were
interested, and found some slight differences for JCB and Diners Club:

Diners Club - 300,301,302,303,304,305 or 36,38 (however, note the 3
digit codes all begin with 30)
JCB - 2131, 1800 or 3

http://perl.about.com/library/weekly/aa080600g.htm

So, just to sum up (in the order of your question)

Mastercard - 51, 52, 53, 54, 55
Visa - 4
Discover - 6011
AMEX - 34, 37
Diners - 30, 36 and 38

And note that the allowable numbers aren't limited to the first couple
digits. For example, the "30" for Diners Club is really short-hand for
the constraint 3000 to 3059 for the first 4 digits. However, the "30"
is sufficient to identify the card as a Diners Club, which sounds like
all that you're interested in. A pretty clear piece of code PHP
showing the ranges can be found at

http://www.analysisandsolutions.com/code/ccvs-ph.htm

I hope this answers your question fully.

Clarification of Answer by morris-ga on 07 Jul 2002 08:24 PDT
Oops, forgot to add my search method. I used the Google Search terms

credit card number coding
credit card number coding Diners Club

and looked through the example scripts that turned up.
hagen-ga rated this answer:5 out of 5 stars
Excellent answer. All what I wanted know, short and complete. Thanks!

Comments  
Subject: Re: credit card types
From: fsw-ga on 07 Jul 2002 08:25 PDT
 
Hi Hagen,

You might find the following link helpful.

How Credit Cards Work
http://www.howstuffworks.com/credit-card2.htm

Best wishes,
fsw

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy