Creditcard Validator

The Credit Card Validator Tool is an online utility crafted for testers to verify if a provided credit card number is valid according to the selected card type. This tool offers a quick and straightforward way for QA professionals to check if an inputted credit card number meets the structural requirements for major card types like Visa, MasterCard, and American Express, among others.

Key Functionalities

  • Luhn Algorithm Validation: This algorithm ensures the number isn’t just structurally correct but also mathematically valid for real-world usage, catching input errors quickly.

  • Format and Length Verification: In addition to card-specific patterns, the validator checks for numeric-only input and confirms the length based on the selected card type. This prevents users from submitting inputs that don’t meet basic formatting rules, further ensuring accurate testing.

How to verify the card number using Luhn's algorithm?

Luhn's algorithm is used to generate and verify the check digit in the card number. The verification process has the following steps:

  • Double the alternative digits from the right. If the value is greater than 9 then take the sum of digits in the value. Eg: Card Number 4376 9909 7878 9659

    • Setp 1 - 4 |3 |7 |6 |9 |9 |0 |9 |7 |8 |7 |8 |9 |6 |5 |9

    • Setp 2 - 8 |3 |14 |6 |18 |9 |0 |9 |14 |8 |14 |8 |18 |6 |10 |9

    • Setp 3 - Sum ( 8 |3 |5 |6 |9 |9 |0 |9 |5 |8 |5 |8 |9 |6 |1 |9 ) = 100

  • Sum all digits generated in the step 3 and take the modulo 10 of the sum.

  • If the modulo 10 is 0 then the card number could be a valid number.

Major credit card issuers

Issuer IIN Prefix Length
American Express 34, 37 15
Visa 4 13, 16
Mastercard 2221–2720, 51–55 16
Maestro 5018, 5020, 5038, 5893, 6304, 6759, 6761, 6762, 6763 12-19
Maestro UK 6759, 676770, 676774 12-19
China UnionPay 62 16-19
Dankort 5019, 4571 16
Diners Club International 36 14-19
Diners Club Carte Blanche 300-305 16-19
Discover 6011, 622126-622925, 644-649, 65 16-19
Elo 5041, 5066, 5067, 5090, 5092, 5097, 5098, 6362, 6363 16
JCB 3088-3094, 3096-3102, 3112-3120, 3158-3159, 3337-3349, 3528-3589 16
Laser 6304, 6706, 6709, 6771 16-19
Visa Electron 4026, 417500, 4508, 4844, 4913, 4917 16
uatp 1 15
Mir 2200-2204 16-19
RuPay 60, 65, 81, 82, 508, 353, 356 16
Verve 506099-506198, 650002-650027, 507865-507964 16,18,19
LankaPay 357111 16
Contributors
References
No references are available!