What these numbers are (and aren’t)
This generator produces Luhn-valid dummy card numbers for the legitimate, everyday developer task of testing checkout forms and payment integrations. Each number passes the mod-10 checksum and carries the correct issuer prefix (IIN/BIN) and length for the chosen network, so your form’s validation, formatting, and card-type detection all behave as they would for a real card. What they are not: connected to any bank, account, or funds. They cannot be used for a real transaction — there’s nothing behind them but math.
Network formats differ — test for that
Card structures are governed by ISO/IEC 7812, and the differences are exactly what your code must handle:
| Network | Prefix | Length | CVV |
|---|---|---|---|
| Visa | 4 | 16 | 3 digits |
| Mastercard | 51–55 / 2221–2720 | 16 | 3 digits |
| Amex | 34, 37 | 15 | 4 digits |
| Discover | 6011, 65 | 16 | 3 digits |
The Amex row is the one that breaks naive forms — 15 digits and a 4-digit CVV instead of the usual 16/3. Generating Amex test numbers lets you confirm your validation and input masks handle the irregular case.
Legitimate uses only
To be explicit: this tool exists for developers testing their own systems — validating form logic, exercising card-type detection, populating staging databases, and load-testing fraud heuristics. The numbers have no monetary value and can’t authorize a purchase. For end-to-end payment-flow testing, always use your gateway’s official sandbox test cards (Stripe, PayPal, etc. each publish theirs), since only those trigger the mock approval/decline responses.
How Luhn works, briefly
Walking the digits right to left, double every second digit (subtracting 9 if the result exceeds 9), sum everything, and a valid number’s total is a multiple of 10. That’s the entire check — which is why editing a single digit of a generated number breaks it: the final check digit is computed from all the others. For other realistic test data (names, emails, addresses) to accompany these, see the Mock JSON Data Generator.