Test Credit Card Number Generator

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

Test cardsGenerated
4445 9814 7416 0070   exp 07/31   cvv 732
4411 4298 8811 7625   exp 09/27   cvv 739
4574 4007 0822 1981   exp 04/29   cvv 747
4349 0154 7369 2713   exp 02/28   cvv 398
4787 2090 8495 5853   exp 05/27   cvv 444

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.