Test Credit Card Number Generator

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

Test cardsGenerated
4824 9351 6430 2138   exp 12/29   cvv 068
4366 9241 7131 1963   exp 06/30   cvv 326
4038 2417 3934 6581   exp 06/31   cvv 467
4890 8734 6657 5292   exp 10/29   cvv 354
4821 8669 9212 6048   exp 03/30   cvv 639

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.