Generate syntactically valid, Luhn-passing TEST credit card numbers by brand (Visa, Mastercard, Amex, Discover, JCB) for QA and form testing. Not real cards.
Pick a brand and press Generate.
⚠ Test data only — these are randomly generated, Luhn-valid numbers. They are not real cards, are not linked to any account, and cannot be charged. Use only for testing.
About this tool
The Test Credit Card Number Generator produces card numbers that are structurally valid and pass the Luhn checksum, so they clear the client-side format and check-digit validation on payment forms during QA and development. Every number is fabricated from scratch: the tool picks a brand IIN prefix and length (Visa starts 4 and is 16 digits, Mastercard 51–55/16, American Express 34 or 37/15, Discover 6011/16, JCB 3528–3589/16), fills the interior with random digits, then computes the final check digit with the Luhn algorithm — doubling every second digit from the right, subtracting 9 where the result exceeds nine, summing, and appending the digit that makes the total a multiple of ten.
These numbers are not connected to any real account, cannot be charged, and must only be used in test and sandbox environments. Payment processors also publish their own official test cards (for example 4242 4242 4242 4242) for end-to-end sandbox flows; use those when a gateway must approve the transaction. This tool is for exercising your own form validation, storage, and formatting logic where a Luhn-valid, brand-shaped number is all you need.
Everything is generated locally with your browser's built-in randomness — nothing is uploaded. Optionally include a random future expiry date (MM/YY, one to five years out) and a matching CVV (three digits, or four for Amex). Generate 1 to 50 at a time and copy the batch in one click.
Frequently asked questions
Are these real credit card numbers?
No. They are randomly fabricated numbers that merely satisfy the Luhn check digit and a brand's prefix and length rules. They are not tied to any bank account, cannot be charged, and exist only to test the format validation on forms and in code.
How is the number made valid?
The tool fixes the brand's leading digits, fills the rest randomly, then applies the Luhn algorithm to the body: doubling every second digit from the right, subtracting 9 when over nine, summing all digits, and appending the check digit that makes the total divisible by 10.
Will these work in a payment sandbox?
They pass Luhn and format checks, which is enough for client-side validation, but a gateway sandbox that must approve a transaction usually requires its own published test cards (like Stripe's 4242 4242 4242 4242). Use the processor's official test numbers for full end-to-end approval flows.
What are the expiry and CVV for?
When enabled, the tool adds a random future expiry (MM/YY, 1–5 years ahead) and a random CVV — three digits for most brands, four for American Express — so a form expecting all three fields can be filled with self-consistent test data.