About this tool
Checkout flows need card numbers to test with, but real cards must never be used in development, and randomly generated “valid-looking” numbers can belong to real cardholders. Payment providers solve this with test card numbers that only work in sandbox mode and trigger specific results: success, a particular decline, or a 3D Secure challenge. This tool lists Stripe’s official test cards and adds a random future expiry date, CVC and cardholder name to each, as a list, JSON or CSV.
Stripe test cards
| Card | Number | Result in test mode |
|---|---|---|
| Visa | 4242 4242 4242 4242 | Payment succeeds |
| Visa (debit) | 4000 0566 5566 5556 | Payment succeeds |
| Mastercard | 5555 5555 5555 4444 | Payment succeeds |
| Mastercard (2-series) | 2223 0031 2200 3222 | Payment succeeds |
| Mastercard (debit) | 5200 8282 8282 8210 | Payment succeeds |
| American Express | 3782 822463 10005 | Payment succeeds |
| American Express | 3714 496353 98431 | Payment succeeds |
| Discover | 6011 1111 1111 1117 | Payment succeeds |
| Diners Club | 3056 9300 0902 0004 | Payment succeeds |
| JCB | 3566 0020 2036 0505 | Payment succeeds |
| UnionPay | 6200 0000 0000 0005 | Payment succeeds |
| Visa | 4000 0000 0000 0002 | Declined: generic decline |
| Visa | 4000 0000 0000 9995 | Declined: insufficient funds |
| Visa | 4000 0000 0000 9987 | Declined: lost card |
| Visa | 4000 0000 0000 9979 | Declined: stolen card |
| Visa | 4000 0000 0000 0069 | Declined: expired card |
| Visa | 4000 0000 0000 0127 | Declined: incorrect CVC |
| Visa | 4000 0000 0000 0119 | Declined: processing error |
| Visa | 4000 0025 0000 3155 | 3D Secure authentication required |
| Visa | 4000 0027 6000 3184 | 3D Secure required on every payment |
Use any future expiry date, any 3-digit CVC (4 digits for American Express) and any name and postcode. Check Stripe’s testing documentation for the full, current list, including cards for specific countries, disputes and refunds.
Other payment providers
Every gateway publishes its own test cards, and many reject other providers’ numbers. Razorpay, PayPal (Braintree), Adyen, Square and Checkout.com each have a “test cards” page in their documentation: search for “provider name test cards”. Many sandboxes also accept the classic Visa test number 4111 1111 1111 1111.
What to test
- Declines: show a clear message for insufficient funds, expired cards and wrong CVCs, and let the customer try another card.
- 3D Secure: required for most card payments in Europe and India. Test that the challenge appears and that your order is only confirmed after it succeeds.
- Webhooks: confirm orders from the payment provider’s webhook, not only the browser redirect. Use the Webhook Tester to inspect the events.
- Never log full card numbers, even test ones, so your logging is safe when real cards arrive.
FAQ
What credit card number can I use for testing?
Use your payment provider’s test cards. For Stripe in test mode, 4242 4242 4242 4242 with any future expiry date and any CVC succeeds.
Do these card numbers work for real purchases?
No. They only work in a payment provider’s test mode and are rejected by live payment systems.
Why not generate random valid card numbers?
A number that passes the Luhn check can belong to a real cardholder. Official test numbers are guaranteed to be fake and produce predictable results.
How do I test a declined payment?
Choose the “Declined payment” scenario. Each Stripe decline card triggers a specific reason, such as insufficient funds or an incorrect CVC.
What expiry date and CVC should I use?
Any date in the future and any 3-digit CVC (4 digits for American Express). This tool fills them in for you.