What Stripe test credit cards are and why developers use them
Stripe test credit cards are fake card numbers that Stripe provides so you can test payment flows without charging real money. When you're building a website or app that accepts payments, you need to see what happens when a customer enters a card number, when a payment succeeds, when it fails, and when it triggers fraud checks — all before you go live. Test cards let you run through those scenarios in a sandbox environment that mirrors the real Stripe system but doesn't touch actual bank accounts.
Stripe separates your account into two modes: test mode and live mode. Test mode is where you use test cards and see fake transactions. Live mode is where real customer payments happen. You switch between them with a toggle in your Stripe dashboard. This separation means you can build and refine your payment experience without risk, and your team members can test independently without seeing each other's live customer data.
Test cards work only in test mode. If you try to use a test card number in live mode, it will be rejected. This is a safety feature — it prevents accidental test transactions from charging real customers.
Key Takeaways
- Stripe test cards are fake numbers that work only in test mode and never charge real money, letting you build and refine payment flows safely.
- Different test card numbers trigger different outcomes: some simulate successful charges, others simulate declines, and others trigger specific fraud or authentication responses.
- You access test mode through a toggle in your Stripe dashboard, and test transactions appear in your test data but never in live reports.
- Test cards require a future expiration date and any three-digit CVC, but the specific card number determines what happens when you process it.
The most common Stripe test card numbers and what they do
Stripe publishes a set of test card numbers on their documentation site. The most widely used is 4242 4242 4242 4242, which simulates a successful charge every time. This is the card you use when you want to confirm that your payment form works, that the charge goes through, and that your confirmation email sends. It's your baseline test.
For testing declines, Stripe provides 4000 0000 0000 0002, which always fails with a "card declined" response. This lets you verify that your error message displays correctly, that the customer sees a clear reason for the failure, and that your form lets them try a different card without reloading the page.
Other test cards trigger specific scenarios: 4000 0025 0000 3155 simulates a card that requires additional authentication (3D find), which is common for international transactions or high-value charges. 4000 0000 0000 0069 simulates an expired card. 4000 0000 0000 0127 simulates an incorrect CVC. Each one teaches you how your system responds to a different real-world problem.
Stripe's full documentation lists dozens of test cards for specific scenarios: cards that trigger specific decline codes, cards that test recurring billing, cards that test different card brands (Visa, Mastercard, American Express). You find the complete list in the Stripe Testing guide under their developer documentation.
How to enter test card information in your payment form
When you're in test mode, your payment form works exactly like it does in live mode — you enter a card number, expiration date, and CVC just as a real customer would. The difference is that Stripe knows you're testing and routes the transaction to its test system instead of the banking network.
For the card number, use any of the test card numbers Stripe publishes. For the expiration date, enter any date in the future — Stripe doesn't care what month or year you choose, as long as it hasn't passed. For the CVC, enter any three digits (or four for American Express). Stripe's test system doesn't validate these fields the way a real bank does; it only cares about the card number itself, because the card number is what tells Stripe which test scenario to simulate.
If you're testing with Stripe's pre-built payment forms (like Stripe Checkout or Payment Element), the same rules explore. Enter a test card number, any future date, any three-digit CVC, and the form will process it according to what that card number is programmed to do.
Understanding test mode versus live mode in your Stripe dashboard
Your Stripe dashboard has a toggle in the top left corner that switches between test mode and live mode. When test mode is on, you see "Viewing test data" and the background is slightly different — usually darker or with a different accent color. This visual difference is intentional; Stripe wants you to notice which mode you're in so you don't accidentally process a real transaction when you meant to test.
In test mode, you see test transactions, test customers, and test payment methods. None of this data appears in your live reports or affects your live account. Your test mode and live mode are completely separate. You can have a test transaction for $10,000 and it won't show up anywhere a real customer or your accountant would see it.
When you're ready to go live, you switch the toggle to live mode. Now real customer cards are processed, real money moves, and transactions appear in your official records. Most teams keep test mode on during development and staging, then switch to live mode only when the product is deployed to production and customers can actually reach it.
Testing different payment scenarios with specific test cards
Beyond the basic success and decline cards, Stripe test cards let you simulate the exact problems you need to handle. If your business model includes subscriptions, you need to test what happens when a subscription renewal fails because the card expired. Stripe provides a test card for that. If you're selling internationally and need to handle 3D find authentication, there's a test card that triggers it every time.
The pattern is always the same: find the test card that matches your scenario in Stripe's documentation, enter it in your form, and observe what your system does. Does your error message make sense? Does the customer know what to do next? Does your backend log the failure correctly? Does your support team have the information they need if the customer contacts you?
Testing with specific cards also helps you verify that your code handles different response codes correctly. A declined card returns a different error code than an expired card, which is different from a card that requires authentication. If your code treats all failures the same way, you might not notice until a real customer hits a scenario you didn't test.
Common mistakes when testing with Stripe test cards
The most common mistake is forgetting to switch back to live mode before deploying to production. If your payment form is still in test mode when customers try to pay, their real cards will be rejected. Always verify your mode before you deploy. Check your code for any hardcoded test mode settings, and make sure your production environment has live mode enabled.
Another mistake is using the same test card for every scenario. If you only ever test with 4242 4242 4242 4242, you never see what your system does when a card declines, when authentication is required, or when any of the dozens of other real-world problems occur. Spend time with the decline cards and the edge-case cards. That's where you find bugs.
A third mistake is assuming test mode is completely safe. While test transactions don't charge real customers, they do create records in your Stripe account. If you're testing with customer data (real names, real email addresses), those records are still subject to your data privacy obligations. Use obviously fake customer data in test mode — "Test Customer" instead of a real person's name — so there's no confusion later.
Webhooks and test events in your development environment
When a real payment succeeds, Stripe sends your server a webhook — a notification that tells your backend to update the customer's account, send a confirmation email, or trigger whatever happens next. You need to test that your webhook handler works before you go live.
In test mode, Stripe sends real webhooks to your development environment when you process a test card. If your development server is accessible to the internet (or if you're using a tool like ngrok to tunnel webhooks to your local machine), you can process a test card and watch the webhook arrive. This is the closest simulation to what will happen in production.
Stripe also provides a webhook testing tool in your dashboard. You can manually trigger a test event — like a charge.succeeded or charge.failed event — without processing a card at all. This is useful for testing your webhook handler when you're not ready to run through the full payment flow, or when you want to test a specific edge case that's hard to trigger with a real card.
Frequently Asked Questions
Can I use test cards in live mode?
No. Stripe rejects test card numbers in live mode. This is a safety feature to prevent accidental test transactions from reaching real customers. If you try to use a test card in live mode, the transaction will fail with a decline response.
Do test transactions appear in my Stripe reports or affect my fees?
Test transactions appear only in test mode reports and never in live mode. They don't count toward your transaction volume, don't incur processing fees, and don't appear on any statement a real customer or accountant would see. Test mode and live mode are completely separate.
What expiration date should I use with test cards?
Use any date in the future. Stripe's test system doesn't validate expiration dates; it only cares about the card number. You could use 12/25 (next month) or 12/99 (far in the future) — either works. The point is to make it obvious you're testing, not to simulate an expired card unless that's the specific scenario you're testing.
Can my team members see my test transactions?
Yes, anyone with access to your Stripe account can see test mode data. Test transactions are visible to all team members with the appropriate permissions. If you want to keep test data private, you can restrict dashboard access through Stripe's role-based permissions, but there's no way to hide test mode entirely from other account users.
How do I test 3D find or other authentication methods?
Stripe provides specific test card numbers that trigger 3D find authentication every time you process them. When you use one of these cards, your payment form will show an authentication prompt (usually a popup or redirect to your bank's site). You can complete the authentication flow and see how your system handles the result. The Stripe documentation lists all test cards that trigger specific authentication scenarios.