About this tool
Wiring up a payment provider or testing a checkout flow is the last place you want to swipe a real card. Test numbers need to actually pass Luhn, match the right length and carry the right brand prefix — otherwise the front-end rejects them before you learn anything.
This generator follows each brand's real rules: Visa starts with 4 and runs 16 digits, Mastercard uses 51-55 or 2221-2223, Amex is 34/37 at 15 digits, Discover uses 6011, 65 or 644-646. The final digit is computed with Luhn, so every generated number validates by construction.
Common use cases
- Front-end form testing, where a card has to clear Luhn before anything else runs
- Seeding dummy orders in a payment gateway sandbox
- Demoing a checkout without touching a real card
- Reverse-testing your own Luhn implementation against known-good output
FAQ
- Can these be charged?
No. They are random numbers shaped to satisfy Luhn with nothing behind them. For real sandbox charges use the official test cards from your payment provider.
- Why do they always pass validation?
The last digit is derived from the preceding digits with the Luhn algorithm, so the result is self-consistent by definition. That is exactly what makes it useful for form testing.
- Can I pick a brand?
Yes — Visa, Mastercard, Amex or Discover, or choose Any to get a mix.
- What is the checker at the bottom for?
Paste any number to instantly see whether it passes Luhn, which is handy for spotting a mistyped digit.