How do I determine if I have a Valid Credit Card Number?

Credit cards use the Luhn Check Digit Algorithm. The main purpose of the Luhn Check Digit Algorithm is to catch data entry errors, but it does double duty here as a weak security tool.

The Luhn Check Digit Algorithm

For a card with an even number of digits, double every odd numbered digit (1st digit, 3rd digit, 5th digit, etc...) and subtract 9 if the product is greater than 9. Add up all the even digits (2nd digit, 4th digit, 6th digit, etc...) as well as the doubled-odd digits, and the result must be a multiple of 10 or it's not a valid card. If the card has an odd number of digits, perform the same addition doubling the even numbered digits instead.

For your convenience, we have examples of the Luhn Check Data Algorithm in C and the Luhn Check Data Algorithm in Java.



Top 5 Free Networking Tools

Bookmark How do I determine if I have a Valid Credit Card Number?

Latest Blog Posts


English English GermanGerman SpanishSpanish FrenchFrench ItalianItalian PortuguesePortuguese RussianRussian DutchDutch
GreekGreek HindiHindi JapaneseJapanese KoreanKorean ChineseChinese Chinese (Simplified)Chinese (Simplified) ArabicArabic

Copyright 2009 Tech-FAQ. All rights reserved. Privacy Policy.