Free Credit Card Validator and Test Number Generator
This free tool checks whether a card number passes the Luhn test and shows its likely network, such as Visa, Mastercard or American Express, based on the leading digits and length. It can also generate random numbers that pass the Luhn check for testing checkout forms. Generated numbers are test numbers only. They are not real accounts and cannot be used to pay for anything.

Credit Card Validator
Generators and Converters
About this tool
Almost every payment card number ends with a check digit calculated with the Luhn algorithm. A number that fails it has a typo, so checkout forms use the test to catch mistakes before sending anything to a bank. Passing the test only means the digits are consistent. It does not mean the card exists, has funds or belongs to anyone.
To validate, enter a number with or without spaces and hyphens. The tool strips them, checks the length, runs the Luhn test and names the network from the leading digits. To generate, choose a network and how many numbers you want. Each result has a correct prefix, length and check digit, so it passes the form-level checks used in development and QA. Payment providers also publish their own sandbox numbers, and those are the ones to use when you test real payment flows.
Please do not type a real card number into any website you do not need to. This page does not store or log what you enter, but for safety use the test numbers here. Generated numbers are for software testing only. Using them to try to buy goods or services is fraud, and they will be declined anyway.
Frequently asked questions
What does the Luhn check prove?
Only that the digits are internally consistent, which catches most single-digit typing mistakes and swapped neighbours. It does not prove that the card exists, is active or has money. Only the card network and the issuing bank can confirm that.
Are the generated numbers real cards?
No. They are random digits with a correct prefix, length and check digit, made for testing forms. They are not linked to any account and any real payment attempt with them will be declined. Use them only in development and QA.
Which card networks are recognised?
Visa, Mastercard, American Express, Discover, Diners Club and JCB, using the leading digits and the usual length of each. A number from another network may pass the Luhn check and show as unknown.
Which numbers should I use to test a payment gateway?
Use the sandbox numbers published in your gateway's own documentation, such as those from Stripe or Razorpay. They trigger specific outcomes like success or decline, which random Luhn numbers do not. The numbers here suit form validation and database tests.
Is it safe to check my own card here?
Nothing is stored or logged, but there is no reason to type a real card number into a tool when a test number does the job. If you only want to find a typo, check the digits against the card by eye or use the test number instead.
