Test credit card numbers

The published payment-gateway test card numbers, generated as a column alongside card type, expiry and currency — so a checkout fixture is one export rather than a copy-paste job.

Generate card data →All field types

What the field emits

The Credit Card # field draws from the four canonical test numbers that payment gateways publish for exactly this purpose:

4111111111111111    Visa
5555555555554444    Mastercard
378282246310005     American Express
6011111111111117    Discover

These are not randomly generated numbers that happen to satisfy the Luhn check — they are the specific values Stripe, Braintree, Adyen and others document as test cards. Every payment sandbox recognises them; no real account exists behind any of them.

That is a deliberate limitation. A generator that produced arbitrary Luhn-valid numbers in real issuer ranges would be producing numbers that could belong to somebody, and there is no legitimate testing reason to want that. Four values is enough to exercise a card-type detector, a form validator and a checkout flow.

Building a checkout fixture

Card number alone is rarely the whole test. A useful payment fixture pairs it with:

  • Credit Card Type — the brand label, for checking your detection logic agrees with the number.
  • Date with a future range and MM/yyyy-style handling — expiry.
  • Pattern ### — CVV, or #### for Amex.
  • Price and Currency Code — the amount being charged.
  • Full Name — cardholder, which should not match the account name in every row if you want to test that path.

Export the lot as JSON for a mock payment endpoint or CSV for a data-driven checkout test.

Declines are the interesting half

A checkout that works with a successful card is the easy case. What breaks in production is the decline path: insufficient funds, expired card, incorrect CVV, 3-D Secure challenge, gateway timeout. Gateways publish specific card numbers that trigger each of those, and they differ between providers.

Those numbers are not built into the generator, because they are provider-specific and change. Add them as a Custom List field, taken from your gateway's own test-card documentation, and you get a fixture that walks every branch of your payment code rather than the happy one. Weight the list by repeating the values you want more of.

Validation edge cases

For testing the card form rather than the payment, add a Custom List with the shapes that break input handling: a number with spaces every four digits, a number with hyphens, a 15-digit Amex where the form expects 16, a number one digit short, and a number that fails the Luhn check. Set Blank % on the CVV field to check required-field behaviour.

What this is not for

These numbers work in sandbox environments. They are rejected by live payment processing, which is the correct outcome and not a bug to work around. Nothing here generates a number that would function as a real payment instrument, and no request to do so would be reasonable — the value of a test card is precisely that it is known, published and inert.

The same principle runs through the rest of the data: IBANs are the right length but fail their checksum, emails land on reserved domains, and IP addresses use documentation ranges. The methodology page lays out each one.

Common questions

Are these real credit card numbers?

No. They are the four test card numbers that payment gateways publish for sandbox testing — Visa 4111111111111111, Mastercard 5555555555554444, Amex 378282246310005 and Discover 6011111111111117. No real account exists behind any of them.

Will they work in a live payment system?

No, and that is the point. They are recognised by gateway sandboxes and rejected by live processing.

Can I generate random Luhn-valid card numbers instead?

The generator deliberately does not do this. Arbitrary numbers in real issuer ranges could correspond to somebody's card, and the published test numbers cover every legitimate testing need.

How do I test declined payments?

Use a Custom List field populated with the decline-trigger numbers from your own gateway's test documentation. Those values are provider-specific, so they are not built in.

Do you generate CVV and expiry dates?

Use a Pattern field with ### (or #### for Amex) for CVV, and a Date field with a future range for expiry. Combine them with the card number field in one schema.

Related generators