Test Credit Card Number Generator

Generate Luhn-valid test card numbers with expiry dates and CVVs for testing checkout forms.

Test cardsGenerated
4671 5641 0357 9541   exp 10/30   cvv 274
4527 6360 9208 8290   exp 01/31   cvv 527
4946 5229 2238 3783   exp 03/31   cvv 848
4660 8577 4323 9119   exp 02/27   cvv 008
4624 6307 5785 6747   exp 05/31   cvv 206

Test numbers only: they pass the Luhn check but are not linked to any account and cannot be charged.
Runs locally in your browser

About the Test Credit Card Number Generator

Testing a payment form needs numbers that pass client-side validation without being real cards. This generator produces numbers with the correct brand prefix and a valid Luhn check digit, along with a plausible expiry and CVV, for Visa, Mastercard, American Express, Discover, JCB and Diners Club. They will pass format validation and be rejected by any real processor, which is exactly what test data should do.

Each brand owns a prefix and a length, and both have to be right or a form rejects the number before it ever looks at a check digit. Visa begins with 4 and runs to 16 digits, Mastercard uses 51 to 55 or the newer 2221 to 2720 range at 16, American Express uses 34 or 37 at 15 digits, Discover 6011 or 65 at 16, JCB 3528 to 3589 at 16, and Diners Club 36 or 38 at 14. The digits in between are random, and the final one is chosen so the Luhn total lands on a multiple of ten.

The detail that breaks test scripts is the security code. American Express prints a four-digit code on the front of the card while every other brand uses three on the back, so a fixture that hard-codes three digits fails as soon as it meets an Amex number.

These numbers are random and not linked to any account, so they cannot be charged. Filling a staging checkout to see how the form behaves is what they are for. For actual payment integration tests, use the official test numbers your processor publishes, since those trigger specific responses such as a decline or a 3-D Secure challenge. To check a number, use the Credit Card Validator.

How to use

  1. Choose the brand and how many.
  2. Copy the numbers into your test form.
  3. Use your processor's official test cards for integration tests.

Common questions

Can these numbers be charged?
No. They are random, not linked to any account, and any processor will decline them.
Why do they pass validation?
They have the right prefix and a correct Luhn check digit, which is all client-side validation checks.
Should I use these with Stripe or PayPal test mode?
Use the official test numbers those services publish; they trigger defined responses. These are for format testing.