Skip to main content

Published

Test Credit Card Numbers for Stripe, PayPal, Adyen, Braintree

Short answer

Test credit card numbers are published by each payment provider and only work in that provider's sandbox or test mode. The most common is 4242 4242 4242 4242 for Stripe and 4111 1111 1111 1111 for Braintree and many other gateways. Use any future expiry date, any 3-digit CVC (4 digits for American Express), and test API keys. Never put a real card into a test environment.

Last updated: 2026-11-07

Part of Testing Guides by business flow.

What are test credit card numbers?​

They are card numbers that payment providers reserve for sandboxes. They pass the basic format check (length, brand prefix and the Luhn checksum) but are not tied to any real account, so no money moves. Each provider decides what a given number does: approve the payment, decline it with a specific code, or demand a 3D Secure challenge.

A test number only works with that provider's test or sandbox credentials. The numbers on this page were checked against each provider's documentation on 2026-11-07. Providers change them, so treat the provider docs as the source of truth.

Which Stripe test card numbers should I use?​

Stripe's testing documentation says to use a valid future date, such as 12/34, any three-digit CVC (four digits for American Express), and any value for other form fields. Use test API keys in every call.

BrandNumberResult
Visa4242 4242 4242 4242Succeeds
Visa (debit)4000 0566 5566 5556Succeeds
Mastercard5555 5555 5555 4444Succeeds
Mastercard (2-series)2223 0031 2200 3222Succeeds
American Express3782 822463 10005Succeeds
Discover6011 1111 1111 1117Succeeds
Diners Club3056 9300 0902 0004Succeeds
JCB3566 0020 2036 0505Succeeds
UnionPay6200 0000 0000 0005Succeeds

Stripe decline and authentication cards​

ScenarioNumberError code
Generic decline4000 0000 0000 0002card_declined (generic_decline)
Insufficient funds4000 0000 0000 9995card_declined (insufficient_funds)
Expired card4000 0000 0000 0069expired_card
Incorrect CVC4000 0000 0000 0127incorrect_cvc
Authenticate unless set up (3D Secure)4000 0025 0000 3155Requires authentication for off-session payments unless the card was set up for future use

Stripe also notes that card-level state from one test can affect later tests using the same card, so use a different test card for each independent end-to-end scenario. For the full Stripe walkthrough with Checkout, Elements, 3DS and webhooks in Playwright, see Stripe testing with test cards in Playwright. That page owns the Stripe-specific detail; this one compares providers.

One more Stripe tip: in test code, Stripe recommends a PaymentMethod such as pm_card_visa rather than raw card numbers in API calls or server-side code, because raw numbers might leave your code non-PCI-compliant when you go live.

What are the Braintree test card numbers?​

Braintree's sandbox only accepts its listed test numbers. Vaulting or transacting with any other number returns a validation error.

BrandNumber
Visa4111 1111 1111 1111
Mastercard5555 5555 5555 4444
Mastercard2223 0000 4840 0011
American Express3782 822463 10005
JCB3530 1113 3330 0000
UnionPay6243 0300 0000 0001

Braintree also lists numbers that return card type indicators, such as 4500 6000 0000 0061 for prepaid, and 5105 1051 0510 5100 (Mastercard), which produces a processor-declined verification.

What are the Adyen test card numbers?​

Adyen publishes a long list by brand and issuing country. Its US debit and Visa examples use an expiry of 03/30 and a CVC of 737, for instance 4400 0020 0000 0004 (US Visa debit) and 4111 1111 4555 1142 (Visa, NL, expiry 03/2030, CVC 737). Use the current table in Adyen's test card numbers because Adyen ties the expiry and CVC to each card and a mismatch will fail.

What about PayPal sandbox cards?​

PayPal's card testing page asks you to use sandbox mode with a sandbox client ID, connect to the api-m.sandbox.paypal.com endpoints, and enter a test number with a future expiry and a 3-digit CVV (4 digits for American Express). It lists a few static numbers, for example 2223000048400011 (Mastercard) and 3636500000000260 (JCB), and offers a credit card generator for more. Generated numbers are tied to your sandbox, so do not reuse them elsewhere.

Why does a test card work in one place and fail in another?​

Test numbers are a contract between your code and one provider's sandbox. Typical causes of a surprise decline:

  • Live keys with a test card. The number is not a real card, so a live gateway rejects it. Check which key your CI loads.
  • Another provider's number. 4242 4242 4242 4242 is a Stripe convention. A different sandbox may not recognize it.
  • Expiry in the past. Test numbers still check that the expiry date is in the future.
  • Wrong CVC length. American Express uses four digits, the rest use three.
  • Adyen-specific pairing. The expiry and CVC listed for the card must match.

How do I use test cards in automated tests?​

  1. Keep numbers in one fixtures file. One place to update when a provider changes a number.
  2. Pick the number by scenario, not by brand. Name them CARD_DECLINED, CARD_3DS, CARD_INSUFFICIENT_FUNDS.
  3. Use a fresh customer per run. Parallel CI runs that share a card or a customer produce flaky results. See parallel CI test data collisions.
  4. Assert on the backend, not only the success page. An order row or a subscription state is stronger evidence than a green toast. See Backend asserts vs UI assertions.
  5. Cover failures as well as the happy path. A declined card and a 3DS challenge are paths real customers hit.
  6. Never commit real card data or live keys. Load keys from your CI secrets store.

If a coding agent writes these tests for you, a person should still confirm that each linked scenario includes the decline and authentication cases. See How do I get humans to review tests my coding agent wrote?

Can I make up a card number that passes validation?​

You can generate a number that passes the Luhn checksum, but a gateway sandbox will usually reject it unless it is on the provider's list. Use the published numbers. And never use a real card number in a test environment: Stripe's documentation notes its services agreement prohibits testing in live mode with real payment method details.

Frequently asked questions

What is the most common test credit card number?

4242 4242 4242 4242 is the best known and is a Stripe test Visa. 4111 1111 1111 1111 is the common Visa test number for Braintree and many other gateways. Each only works in its own sandbox.

What expiry date and CVC do I use for a test card?

Stripe says to use any valid future date and any 3-digit CVC, or 4 digits for American Express. Some providers, such as Adyen, list a specific expiry and CVC per card, so check the provider table.

Can I use a test credit card number on a live site?

No. Test numbers are rejected by live payment systems, and using real card details in a test environment is prohibited by providers such as Stripe.

How do I test a declined card?

Use the provider decline number. In Stripe, 4000 0000 0000 0002 returns a generic decline and 4000 0000 0000 9995 returns insufficient funds. Assert that your app shows the error and creates no order.

How do I test 3D Secure?

Use a provider card that triggers authentication. In Stripe, 4000 0025 0000 3155 requires authentication for off-session payments unless the card was set up. Then drive the challenge frame in your browser test.

Are test credit card numbers real card numbers?

No. They follow the card number format and Luhn checksum but are reserved by the provider for sandbox use and are not linked to a real account.

Cover payment paths without writing every test by hand

Link payment scenarios to Playwright tests, see which ones are covered, and have a person verify what agent-written tests check. 14-day free trial, no credit card.

Start a 14-day free trial · Book a demo