    Using the LUHN Formula

The LUHN Formula does not determine if a credit card number will be approved, but only validates that it is a real credit card number. This formula is known to work on VISA, Mastercard, and AMEX, but probably works on many more.

The following LUHN example validates the number 49927398716.

 Step 1: Double the value of alternate digits of the number beginning with the second digit from the right. ``` 4 9 9 2 7 3 9 8 7 1 6 x2 x2 x2 x2 x2 ------------------------------------------ 18 4 6 16 2 ``` Step 2: Add the individual digits comprising the products obtained in Step 1 to each of the uneffected digits in the original number. `4 +(1+8)+ 9 + (4) + 7 + (6) + 9 +(1+6) + 7 + (2) + 6 = 70` Step 3: The total obtained in Step 2 must be a number ending in zero (30, 40, 50, etc.) for the credit card number to be validated. Since the Sum was 70, our example number is a valid card number because 70 divided by 10 yields no remainder.
A sample perl script version is supplied as a convenience. WebYoda did not write this script nor warrants the accuracy or usefulness of this script. Use of this script is at your own risk.

All Design, Graphics, Infrastructure, and Content is copyright 1996-2005© WebYoda, Inc. All rights reserved.