subsection contents

Credit Card Validator

This little JavaScript application checks the validity and type of a credit card number. Just use the form below to enter a card number. If a card logo appears, then the card number is valid and the card type could be determined from the number.

Supported card types: Visa, MasterCard, American Express, Diners Club, BankCard, Discover and JCB.

Tested with Safari, Firefox and Opera on Mac OS X. According to Browsershots, the page loads and appears to work with Internet Explorer (versions 5.5 to 8.0), Firefox, Opera and Safari on Windows.

Please enter a credit card number to test (e.g. ):
Card Number
Card Type/Issuer


Click on the test credit card numbers below to see the validator in action:


  • The validator checks the card number as you type.
  • If you can't make out the issuer from the logo, hover over it with your mouse and read the tooltip.
  • Any non-alphanumeric characters can act as a separator or delimiter, including spaces.
  • Card numbers can be passed to the page via the url, e.g. CreditCardValidator.html?5105 1051 0510 5100 .