Skip to main content

HomeAll guides

How to Use Stripe Test Credit Cards for Development and Testing

What Stripe test credit cards are and why you need them

Stripe test credit cards are dummy card numbers that let you process payments through Stripe's testing environment without charging real money or hitting live payment networks. When you're building a payment feature, you use these test cards to confirm that your code handles transactions correctly — approvals, declines, errors, and refunds all work the way you designed them.

Stripe provides these cards specifically so you can test your integration before you go live. They're free to use, they never charge anything, and they're designed to trigger specific responses: some cards always succeed, others always fail, and some trigger specific error conditions like expired cards or insufficient funds.

You need test cards because live cards would charge real customers during development, and you can't test error scenarios with real payment networks. Test mode lets you iterate safely.

Key Takeaways

  • Stripe test cards only work in test mode, never in live mode, and they never charge real money or real bank accounts.
  • Different test card numbers trigger different outcomes: some always succeed, others always decline, and some trigger specific errors like expired or insufficient funds.
  • You access test cards through your Stripe Dashboard under the Developers section, where you can also view test transactions.
  • Every test card uses the same expiration date (any future month and year) and the same CVC (any three digits), so you only need to change the card number to test different scenarios.
  • Test mode and live mode are completely separate; switching between them requires toggling a switch in your Dashboard, and transactions in test mode never appear in your live account.

Where to find Stripe's test card numbers

Stripe publishes its test card numbers in the Stripe Documentation, but the fastest way to find them is through your own Stripe Dashboard. Log in, click the Developers link in the left sidebar, then select API Keys. At the top of that page, you'll see a toggle for Test Mode — make sure it's on (it usually is by default).

Once you're in test mode, go back to the Developers section and look for Testing or Test Data. Stripe displays a table of test card numbers there, organized by outcome: cards that always succeed, cards that always decline, and cards that trigger specific error responses.

You can also visit the Stripe documentation directly at stripe.com/docs/testing. The page lists every test card number, what each one does, and the exact response your code should expect when you use it.

How to use test cards in your payment form

Using a test card is identical to using a real card in your payment form — you enter the card number, expiration date, and CVC just as you would with a live card. The difference is that Stripe's test environment intercepts the request and returns a predetermined response instead of contacting your bank.

Enter the test card number in the card number field. For the expiration date, use any month and year in the future — Stripe doesn't care which ones you pick, as long as they're not in the past. For the CVC, enter any three digits.

Submit the form the same way you would with a real card. If you're using a test card that always succeeds, the transaction will complete and you'll see a confirmation. If you're using a test card that always declines, you'll see a decline message. Either way, no money moves and no real card is charged.

Common test card scenarios and what they do

Stripe provides test cards for the most common situations you'll encounter during development. A 4242 4242 4242 4242 card always succeeds — use this to test the happy path where everything works correctly. A 4000 0000 0000 0002 card always declines — use this to test how your form handles rejection and what message the user sees.

Other test cards trigger specific error conditions. A card ending in 0069 simulates an expired card. A card ending in 0127 simulates insufficient funds. A card ending in 0119 simulates a lost card. Each one lets you test a different branch of your error-handling code without having to wait for a real card to expire or a real account to run low on funds.

Stripe also provides test cards for 3D find authentication, international cards, and cards that require additional verification. The full list is in the Stripe documentation, and each card's behavior is documented so you know exactly what response to expect.

How test mode and live mode stay separate

Your Stripe account has two completely independent environments: test mode and live mode. Test transactions never appear in your live account, and live cards never work in test mode. This separation is intentional — it prevents you from accidentally charging real customers while you're developing.

You switch between test and live mode using the toggle in your Stripe Dashboard. When you're in test mode, your API keys are different from your live keys, your transaction history is separate, and your test data never touches your live data. When you switch to live mode, you use your live API keys and real cards start working.

Before you go live, you'll generate separate API keys for live mode and update your code to use those keys instead of your test keys. Stripe makes it clear which mode you're in — the Dashboard shows "Test Mode" at the top when you're testing, and the toggle is always visible so you can see which environment you're working in.

Testing refunds, disputes, and other scenarios

Test cards aren't limited to basic success and decline scenarios. You can test refunds by processing a transaction with a test card that succeeds, then refunding it through your Dashboard or your code. The refund will process when ready in test mode, and you'll see it reflected in your test transaction history.

You can also test webhook events — the notifications Stripe sends to your server when transactions occur. In test mode, Stripe sends test webhook events to your endpoint, so you can confirm that your server receives and processes them correctly before you go live.

For more complex scenarios like disputes or chargebacks, Stripe provides test cards that trigger those conditions. The documentation lists which card numbers create which scenarios, so you can test your dispute-handling code without waiting for a real customer to file a chargeback.

What happens when you switch from test to live

When you're ready to go live, you stop using test cards and start using real cards. The process is straightforward: you update your code to use your live API keys instead of your test keys, and you remove any test-specific logic from your payment form.

Your test transactions stay in your test account history — they don't disappear or move to your live account. Your live transactions start appearing in your live account history as soon as you switch. Stripe keeps the two histories completely separate, so you can always look back at your test data without it cluttering your live records.

Before you switch, Stripe requires you to add your business information and banking details to your live account. This is a one-time setup that takes a few minutes, and Stripe walks you through it in the Dashboard.

Frequently Asked Questions

Can I use test cards after I go live?

No. Test cards only work in test mode. If you try to use a test card number in live mode, it will be rejected as an invalid card number. Once you switch to live mode, you must use real cards to process real transactions.

Do test transactions show up on my real bank account?

No. Test transactions never touch your bank account or any real payment network. They exist only in Stripe's test environment and appear only in your test transaction history. Your real bank account is never affected.

What expiration date should I use for test cards?

Use any month and year in the future. Stripe doesn't validate the expiration date for test cards — it only checks that the date isn't in the past. Most developers use 12/25 or 12/99 for simplicity, but any future date works.

Can I test 3D find with test cards?

Yes. Stripe provides specific test card numbers that trigger 3D find authentication flows. When you use these cards, Stripe simulates the authentication challenge so you can test how your form handles the additional verification step.

What if I accidentally use a test card in live mode?

It will be rejected as an invalid card number. Test card numbers aren't real, so payment networks don't recognize them. Your customer will see a decline message, but no charge will be attempted and no error will be logged against your account.

This guide is for general information only and is not medical, financial, legal, or other professional advice. For decisions specific to your situation, consult a qualified professional. See our Editorial Policy.