How Do You Know if a Credit Card Number is Valid?
As a followup to my recent post about what your credit card number means, I wanted to throw out a bit more credit card trivia and talk about how you can tell if a credit card number is valid.
As you may or may not aware, most credit card numbers are generated based on something known as the Luhn algorithm. It thus stands to reason that a credit card number is valid if (and only if) it satisfies the “Luhn check” (a.k.a., the Mod 10 check), which is a simple mathematical test that involves manipulating the credit card number, adding it up, and checking to see if it’s evenly divisible by ten.
Testing credit card numbers
Here’s how to apply the Luhn check to test whether or not a credit card number is valid:
- Step 1a. For a card number with an even number of digits (e.g., Visa or MasterCard), double alternating digits starting with the first digit in the sequence.
- Step 1b. For a card with an odd number of digits (e.g., American Express), double alternating digits starting with the second digit in the sequence.
- Step 2. If the doubling resulted in a number with two digits, add them together to get a single digit number
- Step 3. Now go back to the original credit number and replace the digits that you doubled with the new value — either the doubled value, or the doubled value with the digits added together — and add it all up.
- Step 4. Check to see if the sum is evenly divisible by 10 (you can simply look to see whether or not it ends with a zero).
If the card number does not pass this check, then it is not a valid number. If, on the other hand, it does pass, then it may be a valid number with valid credit report.
Checking validity: an example
Those steps are a bit convoluted, so here’s a real world example… The following credit card image comes from the CitiCards homepage for their Platinum Select MasterCard. The number on the card is 5424 1801 2345 6789. For starters, the fact that the number starts with a “5” indicates that it’s a MasterCard (as does the little MasterCard symbol on the card).
Since there are sixteen digits, we’ll start by doubling the 1st, 3rd, etc. digits and then summing as outlined above. I’ve highlighted the doubled (and in some cases summed) values in parentheses, below. I’ve also underlined the check digit.
(1+0) + 4 + (4) + 4 + (2) + 8 + (0) + 1 + (4) + 3 + (8) + 5 + (1+2) + 7 + (1+6) + 9
This totals up to 70, which is evenly divisible by 10. In other words, this is a potentially valid credit card number, though I’m sure it doesn’t correspond to a real account number. If it does, then L. Walker (the name on the card) probably isn’t too happy about his/her credit card number being spread around like this.
Disclaimer: Discover is a paid advertiser of this site.
Reasonable efforts are made to maintain accurate information. See the Discover online credit card application for full terms and conditions on offers and rewards.
Modified on December 13th, 2011 - 22 Comments
Filed under: Credit Cards
About the author: Nickel is the founder and editor-in-chief of this site. He's a thirty-something family man who has been writing about personal finance since 2005, and guess what? He's on Twitter!
Related articles...
» What Do Credit Card Numbers Mean? Making Sense of Your Credit Card Number» Visa Credit Card Acceptance Guidelines
» MasterCard Credit Card Acceptance Guidelines
» Establishing Credit With a New Taxpayer Identification Number
» Beware New Credit Card Fees
» Avoiding Credit Card Scammers
» New Sharebuilder Promo Code – $25 Bonus
» Sharebuilder Promo Code – $25 Bonus!
Was this article useful? Please sign up to receive our content via e-mail:
22 Responses to “How Do You Know if a Credit Card Number is Valid?”
Leave a Reply
Top Cards by Category
Earn 100 Reward Dollars after you make $1,000 in purchases in the first three months of Cardmembership.
Earn 25K Membership Rewards(R) points after you spend $2,000 during your first three months of Card membership.
Consumer friendly credit card with a great low rate of 7.25% and save on interest charges. No balance transfer fees and no annual fee.
The new Discover it card is out to change the way people think about credit cards. No annual fee. No overlimit fee. No foreign transaction fee & no pay-by-phone fee. No late fee on your first late payment. And Discover won't increase your APR for paying late.*
The new Discover it card is out to change the way people think about credit cards. No annual fee. No overlimit fee. No foreign transaction fee & no pay-by-phone fee. No late fee on your first late payment. And Discover won't increase your APR for paying late.*
Consumer friendly credit card with a great low rate of 7.25% and save on interest charges. No balance transfer fees and no annual fee.
Limited Time Offer: Get 25,000 Membership Rewards(R) points after you spend $5,000 in the first three months of Card membership. Enroll and select a qualifying airline to receive up to $200 annually in statement credits for incidental fees, such as checked bags and in-flight refreshments, charged by the airline.
The new Discover it card is out to change the way people think about credit cards. No annual fee. No overlimit fee. No foreign transaction fee & no pay-by-phone fee. No late fee on your first late payment. And Discover won't increase your APR for paying late.*
- How to Become a Millionaire
- How to Get Out of Debt
- The Best Dollars I've Ever Spent
- How Our Estate Plan is Structured
- How We Paid Our Mortgage In Less than 10 Years
- Money Making Ideas
- How to Manage Your Asset Allocation with Multiple Accounts
- Consumption Smoothing - Save While the Saving's Good
- How to Save on Groceries
- How Much Life Insurance Do You Need?
- Eleven Great Books About Money
- Dave Ramsey is Bad at Math
- Dish Network Customer Service SUCKS
- $8,000 Homebuyer Tax Credit
- Pay Off Mortgage Early or Invest?
- How to Claim the First-Time Homebuyer Tax Credit
- Termite Control: Sentricon vs. Termidor
- How Much Should You Pay a Babysitter?
- Ethanol Blended Gas = Lower Mileage?
- Reduced Credit Limits? Share Your Experience
- $15,000 Homebuyer Tax Credit
- Will Mac OS X Lion Kill Quicken 2007?
- Federal Income Tax Rates Went Down but Your Federal Tax Withholding Increased. Here's Why...
How to save money on insurance
- More money, more happiness: Do you think money can buy happiness?
- Overdraft fees soared to $32 billion in 2012
- How do you combat prom inflation?
- How should you choose a bank? Look in the mirror.
- The cost of clean water
- College debt 101
- Is it possible to live debt free?
- How to prepare for a home appraisal
- Home prices are up: good news or bad?
- A bit of foolishness

March 1st, 2010 at 4:14 pm
Yup, I’m a geek. I tested one of my cards and it’s valid.
Very cool Nickel.
March 1st, 2010 at 7:11 pm
Nickel,
Like MikeS said, very cool series of articles. I did a search and there are actually tools that will run this validation automatically, like the one at:
http://www.braemoor.co.uk/soft.....card.shtml
(For disclosure, I have nothing to do with that site).
In keeping with the spirit of liking finance and random trivia, I added your post to my roundup of links for the week
March 2nd, 2010 at 1:52 am
For some example cards that are valid you can try:
4012888888881
4012888888881881
5454545454545454
These are purely test cards that are given out by Visa and Mastercard for merchants to test their credit card frontends. For a more complicated test, the expiration on those is 12/49, their CV value is 999, the address is ‘123′ (since really only the numbers in an address matter) and the zip code is 12345.
As a follow up to what you said yesterday, MasterCard is only 5099-5499, with 55 being Maestro. Above that its a mix of private label and Wright Express if memory serves me right.
Discover actually processes for Diners Club International, JCB (Japan Credit Bureau), and CUPS (China Union Pay). Discover is a subset in 6011 and their new range of 6440-6599. Diners Club is 3000-3095, 3600-3699, and 3800-3899. JCB is a subset of 35, while CUPS is a subset of 62.
That’s why AMEX has 34 and 37.
With VISA and MC also identify what type of card you have by the BIN (Bank Identification Number), which are the first 6 digits. So merchants can identify what rate they’re going to be charged for that transaction and whether they should attempt to get the customer to enter their Debit PIN (which is cheaper for the merchant). AMEX on the other hand does not do this, which is why, for example when you shop at Walmart with an AMEX, you must always enter your zip code. Zip code information along with the purchase is known as Level 2 and must be included for certain card types. Since the merchant doesn’t know based on the BIN with AMEX, the only safe move is to always ask for it.
March 2nd, 2010 at 9:13 pm
The card given in the example, 5424 1801 2345 6789, adds up to 70, not 67. Supposedly, this means it could be a valid card. If this really is the example given on the CitiBank site as an “invalid” card it raises questions about their accuracy.
March 2nd, 2010 at 9:24 pm
Gregg: You are indeed correct, and I’m apparently lame when it comes to working a calculator. The example is laid out properly, but I added it up wrong. I’ve fixed it. Thanks!
March 3rd, 2010 at 1:57 am
I got my wallet, grabbed two cards, and did the calcs… they were both valid!
Thanks for the post.
March 23rd, 2010 at 5:44 am
i need a card that is valid
March 23rd, 2010 at 12:48 pm
i want to know if this credit card are valid and if valid i need the whole info about it 4271035222415929
July 30th, 2010 at 5:23 am
can i have sample discover credit card starting with 65 or 64 and having 16 digits
August 12th, 2010 at 5:33 am
please I need a credit card info,i need to subscribe for a dating site called mate1,i will appreciate you help.
August 24th, 2010 at 6:57 am
please i need a credit card for some reasons,please help me out,please a card the have fund on it.
September 23rd, 2010 at 2:00 pm
please i need a credit card that is valid to purchased my school ambition
May 24th, 2011 at 8:36 pm
i will like you to help me check if this card is working and the information about it
4929297172905897
October 3rd, 2011 at 2:28 pm
We are implementing China’s UnionPay. Can someone give me a good test card number? Thanks.
November 21st, 2011 at 9:22 pm
Thanks mate!
January 27th, 2012 at 12:08 am
It is luke skywalker to you, and no i am not very happy with my account.
(jk) but thanks for the info!
January 30th, 2012 at 12:38 am
can any one tell me the valid american express credit card first six digit number …
June 10th, 2012 at 11:37 am
pls i need a credit card information very urgent may Allah bless who give it to me
September 12th, 2012 at 9:09 pm
Hello Pals!!! Please who can help me to get a credit card and its information on it for free ……….cos i really need some ,, and wish to know how to get someone’s credit card information online..please help me and i hope you will ,,… thank you
September 13th, 2012 at 9:49 am
Is there no software or website i can enter a credit card number and details to find out its validity
September 21st, 2012 at 2:21 pm
pls i need a good credit card to enter a big site pls i need somewon to help me with that very urgent pls
October 14th, 2012 at 12:55 am
someone give me credit info me a bummer living on streets using library cpu haard times wen me girlfriend kicked me out with nothing :[