This is How Credit Card Numbers Are Generated

I was reading an article today in one of my favorite publications about how to get free trials without actually using your credit card by generating valid credit card numbers using a simple algorithm called the Luhn check. So I wrote a little script that generates credit card numbers that will be deemed valid by most software checks. This will work because the service won’t know that the credit card is invalid until they actually try to charge it. Well, the card may be valid since my script uses random numbers. Obviously this if for informational purposes only and should never actually be used.

Most credit card numbers are validated using an algorithm called the “Luhn check”. This is a very simple algorithm that doubles the odd digits and does a sum to see if the number is divisible by 10. The credit card companies use a slightly different version that involves a check digit as the last digit. To generate a credit card number that will pass most validation software (as long as they don’t actually try to process the credit card) one only needs to follow these steps to make sure that the generated credit card is valid.

Choose 16 random numbers starting with a 3,4,5 or 6.
Starting with the first digit, double every other number.

If doubling a number results in a two digit number, add those digits together to produce a single digit number

Replace the odd digits with the new ones just created. You should now have 16 numbers consisting of all the new numbers and the original even numbers

Add up all sixteen numbers.

Manipulate the check digit so that the sum is divisible by 10.

Replace the last digit of the original random string with the new manipulated check digit.

Thats really all there is to it. Check out the source of my javascript credit card generator if you want to see how to generate and validate the credit card numbers.

The reason for starting with a 3,4,5, or 6 is that different card types start with different digit. The 3 is American Express, 4 is Visa, 5 is Master Card, 6 is a Discover Card.

Some companies use more digits to show that the card is from them. For example 5254 is a Master Card from the Bank of America and 4013 shows that it is a Visa card from Citibank. Also note that the expiry date has nothing at all to do with the card number.


37 Responses to “This is How Credit Card Numbers Are Generated”

  • SoCo Says:

    This will make plenty of middle eastern credit card thieves very happy. Now they can generate fake credit cards, and try to trade them to rip off other thieves for real bank log-ins, credit cards, or other identity trading stuffs. Usually they buy trojaned credit card generators to do this.

  • Cody Taylor Says:

    @SoCo I don’t think it will really be all that useful due to the lack of expiry date and CVV. But as long as they don’t try and actually process transactions on the cards then I guess it would be possible to make that stuff up and make them look legit.

  • YouMissedASpot Says:

    Actually, Discover cards are all prefixed with 6011, not just 6. Plan accordingly.

  • Dan Grossman Says:

    The first 6 digits are fixed:

  • Ryan Says:

    Haha, I suppose I shouldn’t have linked to a query where I had mis-spelled a word, eh?

    /yes, I’m an idiot.

  • Graham King Says:

    I did something similar many years ago, and put it up here:

    Take a look at the comments on that page for what you have to look forward to! :-)

  • chibimagic Says:

    What’s the point of replacing the odd numbers with their doubles? It just translates the odd numbers from 0123456789 -> 0246813579, which does nothing if you’re starting with 16 random numbers anyway.

  • Cody Taylor Says:

    @chibimagic You only double the odd numbers on the check. You don’t actually replace those numbers.

  • Cody Taylor Says:

    @Graham King Those are really some great comments. Unfortunately I haven’t gotten any crazies insofar. Thanks for sharing.

  • Houttar, King of Atholonthos Says:

    Greetings. I am Houttar. I am the King of Atholonthos. It is a lost kingdom under the sea. Our people are monstrous creatures who are able to breath in the water. We made our great civilisation 23 000 B.C. I am the ruler for the last 240 years. I was always really good and tried to satisfy every man in our society. But then, all of a sudden, one of my close partners, Littuen started rebellion against me. Soon enough, he got himself a many followers. They are trying to kill me so they’ll rule my kingdom and exploit my people. In the name of my men, wives and kids, I am asking you for a help. Send me a proper card number with an additional details so I could get money that I need to buy weapons and armor to defend my kingdom. Thanks.

  • Adit Says:

    and what about the 3 digit security number?

  • Cody Taylor Says:

    Houttar, I am sorry to hear about your misfortunes but I am unable to proceed with any activities that may be, in any way, illegal. I think you should look into some ninja like assassination techniques to rid your kingdom of the betrayer.

  • Cody Taylor Says:

    @Adit What about it?

  • adit Says:

    how to generate it?
    can you generate it just for example?

  • Emmy Says:

    Helo,please i will need ur assistant for a valid credit card so as to pay for my tution fee please it’s urgent come to my rescue

  • jonh Says:

    how i can get the 3 last digit…i have just fullcard number

  • kwasi Says:

    hi boss,pls i do understand how 2 create de credit card numb. but i ll like 2 kno if it does work perfect, pls get bk 2 me thanx.. kwasi

  • Will Bullock Says:

    I would like to validate my card number with money and also get a security code because any company over the phone will ask yuan for that.

  • joseph Says:

    i needto pay for school fees and my parent are poor.please can you assists me on how to generate credit card with ccv.please get back to me asap.

  • Josef Says:

    Please i really need a credit card to pay for my school and finish my admission to school in the uk , please try to help me cos i really need them, will try to pay you back if am granted this Sir, thanks

  • jackyboy Says:

    so are we just supposed to make up the names and verification codes of these?

  • Payton Says:

    I got this site from search engeen..can yu put me through..but I need to be frank wit myself which means I wil be greatful glad and thx if I can get complete card and the code number wit every data!!! More abilities to yur elbow!!!!!

  • Malvin Mingle Says:

    I need a cc with full information to upgrade a site

  • Adams Says:

    I need master card i want 2 pay 4 it cos the one in my country(nigeria) has 4 password instead of 3 pls help me.i want 2 buy goods online.

  • Mark seth Says:

    Please i need a cc to help pay my registration fees and also to do some business. Please help me

  • Alanya Says:

    Pls I need credit card number with experation date, CCV and name. I want to start online bussines, I will pay to you!!! Thank you!

  • Ashely Smith Says:

    Can u send me valid credit card numbers asap….im going outta town in 3 weeks amd need to shop online. Help!

  • Ashely Smith Says:

    Send valid credit card and cvv codes to pleassee and thanx! Asap please

  • john Says:

    please can someone help me to genrate cridet card cvv?

  • paula Says:

    How do I fund my generated credit card. How do I register it with a bank, how do i use it to do legitimate trade? how do I use it to transfer fund?

  • derek Says:

    This c.c. info is totally useless unless there is a way of creating or disseminating the security code on the back(the last 3 digits. I hate these idiots who only produce half an answer to a problem.
    Anyone with a shred of technical knowhow can generate c.c numbers but only the exceptional can defeat the security code on the back. Any takers?
    No,i didn’t think so.

  • lingo Says:

    i need ccv or bank login………i dont mind if u can traing me how to get credit card or bank login.

  • ebenezer Says:

    want to generated a card and use it for shopping
    how do i go by that plz

  • ebenezer Says:

    Send valid credit card and cvv codes to EBENEZER.FERGUSON@YAHOO.COM pleassee and thanx! Asap please

  • Stefan Says:

    how can i get the credit card cw pls help me

  • BlackieChan Says:

    How do I fund my generated credit card. How do I register it with a bank, how do i use it to do legitimate trade? how do I use it to transfer fund?