Web Culture

Credit Card Numbers Are Not Random: How To Read & Understand Them Yourself

Angela Randall 18-10-2012

understand credit card numbersYou may have heard before that credit card numbers follow a certain pattern and structure so that they can be validated before a transaction is accepted. However, it’s one thing to know that the structure is there and another thing entirely to understand how credit card numbers work.


Why would this knowledge be useful? Well, if you run a small business that doesn’t process credit card payments immediately, you could save yourself money by ensuring the card details are valid. If you don’t, well it could still be fun to show off your skills at parties. Here’s how you do it.

Learning Where The Numbers Come From

Credit card numbers are not random. There’s a special set of numbers to show information about the card issuer and another set to show information about the card holder. One other number is also important, but we’ll come to that later.

The very first number is the Major Industry Identifier (MII) and it tells you what sort of institution issued the card.

  • 1 and 2 are issued by airlines.
  • 3 is issued by travel and entertainment.
  • 4 and 5 are issued by banking and financial institutions.
  • 6 is issued by merchandising and banking.
  • 7 is issued by petroleum companies.
  • 8 is issued by telecommunications companies.
  • 9 is issued by national assignment.

The first six digits are the Issuer Identification Number (IIN). These can be used to look up where the card originated from. If you have access to a list that details who owns each IIN, such as this list of popular IINs on Wikipedia, you can see who issued the card just by reading the card number.

Here’s a few you might recognise:

  • Visa: 4*****
  • American Express (AMEX): 34**** or 37****
  • Diner’s Club International: 36****
  • Mastercard: 51**** to 55****

The seventh digit to the second-to-last digit is the customer account number. Most companies use just 9 digits for the account numbers, but it’s possible to use up to 12. This means that using the current algorithm for credit cards, the world can issue about a trillion cards before needing to change the system.

understand credit card numbers

We often see 16-digit credit card numbers today, but it’s possible for a card issuer to issue a card with up to 19 digits using the current system. In the future, we may see longer numbers becoming more common.

The very last digit of each credit card is the check digit, or checksum. It is used to validate the credit card number using the Luhn algorithm, which we will now explain in detail.


The Luhn Algorithm Validation Check

The Luhn Algorithm is used to validate all sorts of numbers, including credit cards, IMEI numbers and some social security numbers. It’s not designed to be a cryptographically secure hash function, but merely a way to check errors are not made when recording numbers. It is not foolproof, but is generally considered to be useful.

Take the credit card number and read the digits from the right. Double every other number and write them down – if you do it in the same order as your card is written it will help with clarity. Now, wherever you have calculated a double-digit number, change it so that it reads as “first digit + second digit” (in other words, sum the digits of the products). Finally, take your calculations and add those numbers to the numbers remaining on your card that you didn’t double. A legitimate credit card number will give you a result that is divisible by 10.

For instance, let’s use a number I’ve just made up: 4634 8932 1298 2767. I’ll enter it into a table to make it easier to understand the steps.

understand credit card numbers


Try it yourself using the card from the picture earlier in this article. What can you learn from it?

Image Credit: Shutterstock, Shutterstock

Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.

Whatsapp Pinterest

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Irshad Fazal
    February 2, 2013 at 3:46 pm

    the reason of coming here for me was to get a free credit card number thats always valid and somebody will show me his or her CSC NUMBER expiration date and card number i need it for game i need to spend 500 dollars per year in online gaming but i dont have that cash

  2. Jim Spencer
    October 26, 2012 at 5:52 pm

    Pretty nice article! I am older than most of the crowd reading this, but I have to say, I learned something out of this!

  3. Constantin Capraru
    October 26, 2012 at 5:58 am

    interesting. I didn't knew that :)

  4. Pavels Ostrovskis
    October 25, 2012 at 9:09 pm

    Interesting information indeed! Now when I look at my credit cards the pattern is so obvious (in the first digits at least), how haven't I seen it before? :)

    Thank you for sharing this.

  5. Michelle Barry
    October 25, 2012 at 4:36 pm

    Thanks for this article. I Ann running off right now to check all my cards. Should prove quite informative!

  6. Nguy?n Tân
    October 25, 2012 at 4:17 am

    I'm not understanded!

  7. John Schmitt
    October 24, 2012 at 5:39 pm

    Are we allowed to "Sharpie out" the numbers so they are not readable from a distance?

    • Angela Alcorn
      November 9, 2012 at 10:39 am

      Some people might not accept the card afterwards, so I wouldn't. :)

  8. Absolom Green
    October 24, 2012 at 4:21 pm

    Wow, that was quite informative, and here I always thought they were random, you learn something new every day!

  9. PJ Wessels
    October 24, 2012 at 3:11 pm

    I had noticed some similarities but this cleared up any remaining fog.

  10. Tashfi Neutron
    October 23, 2012 at 9:22 pm


    Never thought they'd even mean something :p

  11. Sri Vastav Reddy
    October 23, 2012 at 7:41 am

    never thought it would be soo.. complicated :)

  12. Eath Chantrea
    October 23, 2012 at 7:23 am

    What useful information.

  13. Prateek Kumar Rajput
    October 23, 2012 at 6:57 am

    Nice article..
    Have always wondered where these sequences come from..

  14. Earl Disselhorst
    October 23, 2012 at 4:13 am

    Great Linux laptop

  15. nv martin
    October 22, 2012 at 8:11 pm

    So how much easier did you just make if for fraudulent persons 2 use someone else's account? Or did they all already have it figured out??? ;>{

  16. Cristina McElwee
    October 22, 2012 at 7:04 pm

    So there *is* method to the madness! Nice to know!

  17. Debbie Strain
    October 22, 2012 at 6:44 pm

    I am not sure I would ever use this information however it was very interesting reading. I always thought the numbers were just random.

  18. Lyn Sweetapple
    October 22, 2012 at 6:01 pm

    this is neat. I will share it with my math teachers.

  19. Shubharup Ganguly
    October 22, 2012 at 5:05 pm

    I don't have a physical credit card, but I have tons of VCC's. Although truth be told, it never came to my mind that the numbers might not be randomly generated. I thought the number was a long string of numbers so that it would be hard for hackers to generate the password.

  20. Gerhard Tinned
    October 22, 2012 at 2:43 pm

    Oh i totally forgot ... The Luhn Algorithm Validation Check is not make sure the number is really valid and existing!! It just gives you a check to make sure the number is in a possible number according to the mathematical rules. To check if the number is really an active credit-card number you have to check it against the credit-card companies / payment providers system.

  21. Gerhard Tinned
    October 22, 2012 at 2:33 pm

    The creditcard number includes a lot of interesting information. Like the card brand (BIN) that gives a webshop the possibility to detect the brand even without asking the user. The creditcard number even contains the country where the card was issued. Or at least there is a possibility to track it back to a country with the right lists! :-)

    October 22, 2012 at 5:04 am


  23. Harshit Jain
    October 21, 2012 at 5:24 pm

    I always wondered what those numbers meant. Thanks for the information.

  24. Vivek Kumar
    October 21, 2012 at 8:56 am

    nice info to start with.......

  25. Jesse Manalansan
    October 21, 2012 at 3:35 am

    Wow, thanks for sharing us this info!

  26. Rabi
    October 21, 2012 at 2:24 am

    This an interesting fact. I never knew that this numbers are mathematically created. What about the 3 digit numbers at the back of your card?


  27. Saeef Alam
    October 21, 2012 at 1:45 am

    I'm taking a Discrete Structures class in university and started learning about stuff like this recently. SO lost, lol.

  28. Naoman Saeed
    October 20, 2012 at 11:45 pm

    Good info

  29. Conrad
    October 20, 2012 at 10:28 pm

    Well it might work for some but not me VISA=70
    and American Express=70 too!

  30. Anish T A
    October 20, 2012 at 3:46 pm

    Nice article.It is quite interesting to know that you can identify which institution a credit card is issued just by looking at the card number.Thanks for the info.

  31. Roberta Boe
    October 20, 2012 at 11:13 am

    This is a fascinating article. I always wondered how the numbers ae created. Would you write more about cloning cards! And ways to avoid having your cards cloned?
    It happened to me once in a itel in NYC and I was very upset because I love the place but will not dare stay there again!

  32. Mark
    October 20, 2012 at 10:14 am

    sorry it seems that i have confused myself with that one hahaha i though you're suppose to subtract the double digit with the original digit and use the remainder...

  33. Mark
    October 20, 2012 at 10:09 am

    Uhh sorry but i do not get it about the (Now, wherever you have calculated a double-digit number, change it so that it reads as “first digit + second digit” (in other words, sum the digits of the products)) part...please help...

  34. Naren Vishani
    October 20, 2012 at 8:37 am

    Mathematica combinations shall always keep us amazed. wow thanks Angela

  35. afasja
    October 20, 2012 at 6:37 am

    Very useful information, thanks for sharing

  36. mike
    October 20, 2012 at 6:31 am

    Very cool info I never new this thanks for teaching me something new

  37. Marc Carrion
    October 20, 2012 at 4:00 am

    That's really interesting. Now you can see if the credit cards you get in the mail are real.

  38. Jérémie Fortin
    October 20, 2012 at 3:37 am

    Cool to see thery weren't randomized

  39. formerbankman
    October 19, 2012 at 10:58 pm

    There are phone books that all the major banks are issued with, that contain the credit card issuer identification numbers and the corresponding banks address and contact details for every bank in the world. This information is used every day by your banks lost & stolen card department. It is used to direct a person to their specific bank so that their card can be cancelled & replaced. I have used this info on many occasions for work.

  40. Carl
    October 19, 2012 at 9:52 pm

    = 91

  41. sheila and andy
    October 19, 2012 at 9:49 pm

    The sum of the digits in the above example equal 91 however. And we tried using our own and got an odd number as well. Hmm.

    • Rudiger Vanden Driessche
      October 21, 2012 at 12:59 pm

      my calculator says it's 90
      it also checks ok on creditcardity.com
      it's a Visa card (starts with 46)

  42. Edward Bellair
    October 19, 2012 at 9:19 pm

    Just like your v.i.n. and s.s. number, everything means something about where you got it from.

  43. Roger Bertrand
    October 19, 2012 at 9:03 pm

    Does anybody know if the Passwords or Secret Key or PIN is located anywhere on the physical card or in teh magnetic stripe?

  44. Roger Bertrand
    October 19, 2012 at 9:02 pm

    Does anybody if the Passwords or Keys to have access to cash with the Cards through the ATM is located anywhere on the Card or in the Magnetic Stripe on the back?

    • matt
      October 20, 2012 at 4:47 am

      The writer of the article messed up the explanation and left our key parts of the formula. The idea is there, but his formula is incomplete. Check the wikipedia link for Luhn Algorithm for the rest of the info. it works, but not as this article is written ...

      sorry author, you missed ;-)

      • Roger Bertrand, P. Eng.
        October 21, 2012 at 4:28 am

        Hello Matt,

        THis does not reply to my question. My question is: is the PIN and other data stored on the card, namely on the magnetic stripe itself? Up to now I have never ever been able to find a clear and crips answer to that question.

      • Rudiger Vanden Driessche
        October 21, 2012 at 12:40 pm

        I don't see where the author missed. The explanation could be a bit simpler but it's correct.

  45. Roger Williams
    October 19, 2012 at 8:23 pm

    why do I get 91?

  46. Deji Greg
    October 19, 2012 at 7:35 pm

    Thanks a lot. Very good useful info

  47. Wally
    October 19, 2012 at 6:56 pm

    Ok, you lost me. What does the last digit, the checksum, have to do with the Luhn validation check?

  48. Anonymous
    October 19, 2012 at 6:51 pm

    INteresting. I always thought it was just a randomly generated number.

  49. Sam Kar
    October 19, 2012 at 5:24 pm

    Wow, nice and informative article. Thanks a lot!

  50. LedCara
    October 19, 2012 at 4:44 pm

    Nice ;') I love the information you've shared :)

  51. Dennis
    October 19, 2012 at 4:24 pm

    Did anyone else try this formula on their cards?
    My American Express worked, but my Master card numbers totaled 34 for the odd and even numbers. Yes, 34 is divisible by 10, but not with an integer result.

  52. Shmuel Mendelsohn
    October 19, 2012 at 3:33 pm

    I do not know anyone who could actually benefit from this article in a practical way, but it sure is cool and fun as well. I suppose that qualifies me as a geek!

  53. venkatachalam
    October 19, 2012 at 3:30 pm

    Very informative article.

  54. illegal3alien
    October 19, 2012 at 3:28 pm

    A similar format is followed for barcodes (UPCs). The first digits are a block assigned to a particular manufacturer, the ends digits are unique to each product the company makes, and the last digit is a check digit to ensure that the code was scanned correctly (the device computes the last digit and compares it to the value it scanned)

    • Totoy Badiola
      October 22, 2012 at 2:41 pm

      I think, the first two numbers in a barcode refer to the manufacturer's country.

  55. NL495
    October 19, 2012 at 3:20 pm

    I never knew this. Thanks for the article. Going to share this.

  56. Christine Hicks
    October 19, 2012 at 3:20 pm

    Who Knew...

  57. Mac Witty
    October 19, 2012 at 1:30 pm

    Great to know the system behind

  58. Duane Arsenault
    October 19, 2012 at 1:04 pm

    Good thing you need to have the verification number on the back and the expiry date or there would be more credit card number guessing going on!

  59. Amartuvshin Tseden-Ish
    October 19, 2012 at 11:56 am

    All of my cards had easy to remember/easy to input sequences of four digits like 8520, or 4346. is that so with the majority of cards?

  60. salim benhouhou
    October 19, 2012 at 10:09 am

    thank you angela . i thought they are random before .

  61. Kaashif Haja
    October 19, 2012 at 9:52 am

    Cool Info.
    "divisible by 10" worked for me:)

  62. Timo
    October 19, 2012 at 8:58 am

    Now thats a cool piece of information I didn't know yet. Thanks.

  63. david omongot
    October 19, 2012 at 6:47 am

    This is good General Knowledge Info, especially to those who are always curious. I had never thought of it, and now it has got me wondering, good thing the answer is right here, thanks.

  64. Boni Oloff
    October 19, 2012 at 6:28 am

    I have ever heard about the way to verify it, but never think first numbers talks about company category..

  65. Yiz Borol
    October 19, 2012 at 3:41 am

    yeah, one of my first programs was the luhn formula for fake cc evaluation.

  66. Abidhusain Momin
    October 19, 2012 at 3:33 am

    Important information for us specially when you get someone's credit card.. :)

  67. tom hartnett
    October 19, 2012 at 1:57 am

    Like the numbers on a check, once you understand the code it makes sense. Thanks.

    • Shmuel Mendelsohn
      October 19, 2012 at 3:34 pm

      or the numbers in a UPC code!

  68. Ashwin Ramesh
    October 19, 2012 at 1:36 am

    Wow! Never knew about this. Thanks for the article, Angela!

  69. Anonymous
    October 19, 2012 at 1:03 am

    Useful information for those curious and were wondering whether there is any method in the madness....

  70. jan
    October 19, 2012 at 12:34 am

    The number is also written in a Logarithm Modulus 10, in which a number is easily checked. For example 6666 6666 6666 6666 would check out as a valid number. You can easily make a small program based on this logarithm to check if the sequence is real.

    • Ketharaman Swaminathan (GTM360 Marketing Solutions)
      October 19, 2012 at 7:37 pm

      Actually, you can get an Excel calculator for this here: [Broken Link Removed]

      While this article doesn't mention it, merchants in many countries (e.g. Canada) must use receipt #s that are MOD10-compliant. This provides a quick-and-dirty way for (1) a company to verify that the receipt attached by employees to their expense claims is not a fake (fudgers beware!) (2) tax authority to do the same w.r.t receipts used by companies while claiming tax deduction on a business expense.

  71. Gary Daleen
    October 19, 2012 at 12:20 am

    Always a method to madness, keep ur #'s safe

  72. Ben Gentry
    October 18, 2012 at 11:49 pm

    I have always wondered about the numbers on my cards

  73. Igor Rizvi?
    October 18, 2012 at 10:37 pm

    And i always tought it was just a random scrambled numbers lol,thanks ,im sharing this..

    • Samrudh Shetty
      October 20, 2012 at 3:54 pm

      Me to.

      • Lisa Santika Onggrid
        October 22, 2012 at 12:29 pm

        Yeah. Who knows there is science behind it?
        Thank you MUO. I learn something new everyday.