Stripe provides test card numbers so you can build and test payment features without using real money or real card details
When you're building a payment system with Stripe, you need to test how transactions work before you go live. Stripe's test card numbers let you simulate different payment scenarios — successful charges, declined cards, authentication challenges — in a sandbox environment that doesn't touch real bank accounts or charge actual money.
Test cards work only in Stripe's test mode, which you enable in your Stripe dashboard. You can use any expiration date in the future and any three- or four-digit security code. The card number itself is what tells Stripe how to respond: some numbers simulate successful payments, others trigger specific decline reasons, and others test 3D find authentication or other fraud checks.
Key Takeaways
- Test card numbers work only when your Stripe account is in test mode, which you toggle in your dashboard settings.
- Different test card numbers produce different outcomes — some succeed, some decline with specific reasons, and some trigger authentication flows.
- You can use any future expiration date and any three- or four-digit CVC with test cards; Stripe ignores these values.
- Test transactions appear in your Stripe dashboard under test data, separate from live transactions, so you can review them without affecting your live account.
How to Enable Test Mode in Your Stripe Dashboard
Open your Stripe dashboard and look for the toggle switch labeled "Viewing test data" in the top right corner. When this toggle is on, your dashboard shows test transactions and test API keys. When it's off, you see live data and live keys.
To switch between modes, click the toggle. Your view will refresh and show the opposite mode. Make sure you're in test mode before you create test transactions — if you're in live mode and use a real card number, you'll charge real money.
Common Test Card Numbers and What They Do
Stripe publishes a standard set of test card numbers that produce predictable results. The most common one is 4242 4242 4242 4242, which always succeeds. Use this number when you want to confirm that your payment flow works end-to-end.
Other test numbers trigger specific outcomes. 4000 0000 0000 0002 simulates a card that declines with a generic decline code. 4000 0025 0000 3155 triggers a 3D find authentication challenge, which tests whether your integration handles the additional verification step. 5555 5555 5555 4444 is a Mastercard test number that succeeds.
Stripe also provides test numbers for specific decline scenarios. 4000 0000 0000 9995 declines with an "insufficient funds" message. 4000 0000 0000 9987 declines with a "lost card" message. These let you test how your process handles different failure reasons and what message you show the customer.
Testing 3D find and Authentication Flows
If your integration uses 3D find (also called Strong Customer Authentication or SCA), you need test cards that trigger the authentication step. 4000 0025 0000 3155 is the standard test number for this. When you use it, Stripe returns a response that requires additional authentication before the payment completes.
In test mode, Stripe automatically completes the authentication without requiring the customer to enter a code. This lets you test the full flow without manual intervention. In live mode, the customer would receive an authentication prompt on their phone or in their banking app.
What Expiration Dates and Security Codes to Use
For test cards, the expiration date and security code don't matter — Stripe ignores them. You can use any date in the future and any three- or four-digit number. Many developers use 12/25 as the expiration and 123 as the CVC for simplicity, but 12/99 and 1234 work just as well.
The only requirement is that the expiration date must be in the future. If you use a date in the past, Stripe will decline the card as expired, even in test mode. This is intentional — it lets you test how your system handles expired cards if you want to.
Finding Test Transactions in Your Dashboard
After you run a test transaction, it appears in your Stripe dashboard under the Payments section. Make sure you're viewing test data (the toggle in the top right should be on). Test transactions are labeled clearly and separated from live transactions.
Click on any test transaction to see its full details: the card number used, the amount, the timestamp, and the outcome. If the transaction failed, the dashboard shows the decline reason. This information helps you understand what your integration did and whether it handled the result correctly.
Testing Webhooks and Event Handling
Stripe sends webhook events for test transactions just as it does for live ones. When you process a test payment, Stripe fires events like charge.succeeded or charge.failed to your webhook endpoint. This lets you test whether your backend correctly receives and processes these events.
To test webhooks in development, you can use the Stripe CLI, which forwards webhook events from Stripe to your local machine. This eliminates the need to deploy to a public server just to test event handling. The Stripe CLI also lets you trigger specific events manually for testing scenarios that are hard to reproduce otherwise.
Frequently Asked Questions
Will test transactions show up on my real bank account or credit card?
No. Test transactions exist only in Stripe's test environment and never touch real banking systems. They don't appear on your bank statement or credit card statement, and no money changes hands.
Can I use a real credit card number in test mode?
You can, but you shouldn't. Stripe will reject real card numbers in test mode to prevent accidental charges. Always use the test card numbers Stripe provides.
What happens if I accidentally use a test card number in live mode?
Stripe will decline it. Test card numbers are blocked in live mode, so you won't charge a customer. This is a safety feature to prevent test data from reaching your live payment processing.
Do I need different test cards for different payment methods?
Stripe provides test numbers for Visa, Mastercard, American Express, and Discover. If you support multiple card brands, test with at least one number from each brand to confirm your integration handles them all.
How long do test transactions stay in my dashboard?
Test transactions remain in your dashboard indefinitely. You can review them, search them, and use them to understand how your integration behaved. They don't expire or get automatically deleted.