Credit Card Number Verification Routines in JavaScript

What is it?
These are a bunch of JavaScript routines to verify the validity of a credit card number.

What does it not do?
Please note that these routines only determine whether a credit card is valid. A valid calid credit card number does not imply that it is a credit card that has actually been issued or (if it has been issued) is in good standing.

To actually see if a valid credit card number has been issued and is in good standing you would have to use a Credit Card Merchant Service. Credit card merchant services are beyond the scope of this document.

These routines are licensed for usage and redistribution under The GNU General Public License

How do I use it?
You could use these routines along with your FORMs to validate credit card numbers. By doing this number validation via JavaScript you can save unneccesary calls on your CGI scripts.

To use these routines you would have to download the routines. You would then have to plug in these routines between the <HEAD> and </HEAD> of your HTML file containing the form. The routines provide the following functions -

If you use this code, please email me your comments and suggestions. Since this is purely voluntary work, any encouragement I get goes a long way in motivating me to keep working on these.

Copyright (c) 1998 Sudhakar Chandrasekharan (
Last Updated Tue Jul 14 12:05:48 PDT 1998