Lorem.space

Stripe test cards and test card numbers

Updated

The standard Stripe test card is 4242424242424242, the Visa card that Stripe uses in its own examples. It gives a successful payment. Use any future expiry date, such as 12/34, and any three-digit CVC (four digits for American Express). Stripe's test cards work only with your test API keys in test mode or a sandbox, and they move no money. The tables below list Stripe's other dummy cards for each brand, country, decline, fraud check, dispute and 3D Secure case, with a copy button next to each number.

How to use Stripe test cards

  1. Open a sandbox with the account picker in the Stripe Dashboard.
  2. Use your test API keys, such as a secret key that starts with sk_test_, in every API call.
  3. Enter a test card number in your payment form or in the Dashboard.
  4. Use any future expiry date, such as 12/34.
  5. Use any three-digit CVC, or any four digits for American Express.
  6. Use any value for the other fields, such as name and postal code.

In test code, Stripe recommends a PaymentMethod ID such as pm_card_visa instead of a card number. If your server-side code uses card numbers, it might not be PCI compliant when you go live. For example:

curl https://api.stripe.com/v1/payment_intents \
  -u "sk_test_...:" \
  -d amount=500 \
  -d currency=gbp \
  -d payment_method=pm_card_visa

When you go live, replace the test publishable and secret keys with live keys. Live payments fail while your integration still uses test keys.

Stripe test card numbers by brand

Each of these cards gives a successful payment for its card brand.

BrandNumberCVC
Visa4242424242424242Any 3 digits
Visa (debit)4000056655665556Any 3 digits
Mastercard5555555555554444Any 3 digits
Mastercard (2-series)2223003122003222Any 3 digits
Mastercard (debit)5200828282828210Any 3 digits
Mastercard (prepaid)5105105105105100Any 3 digits
American Express378282246310005Any 4 digits
American Express371449635398431Any 4 digits
Discover6011111111111117Any 3 digits
Discover6011000990139424Any 3 digits
Discover (debit)6011981111111113Any 3 digits
Diners Club3056930009020004Any 3 digits
Diners Club (14 digits)36227206271667Any 3 digits
BCcard and DinaCard6555900000604105Any 3 digits
JCB3566002020360505Any 3 digits
UnionPay6200000000000005Any 3 digits
UnionPay (debit)6200000000000047Any 3 digits
UnionPay (19 digits)6205500000000000004Any 3 digits

Stripe sets cross-border fees by the country of the card's issuer. Cards issued outside the US, such as JCB and UnionPay, might show a cross-border fee even in test environments.

Stripe test cards by country

These cards give a successful payment from a card issued in that country. Stripe's documentation lists more than 60 countries. This is a selection:

CountryNumberBrand
United States4242424242424242Visa
Canada4000001240000000Visa
Mexico4000004840008001Visa
Brazil4000000760000002Visa
United Kingdom4000008260000000Visa
United Kingdom4000058260000005Visa (debit)
United Kingdom5555558265554449Mastercard
Ireland4000003720000005Visa
Germany4000002760000016Visa
France4000002500000003Visa
Spain4000007240000007Visa
Italy4000003800000008Visa
Netherlands4000005280000002Visa
United Arab Emirates4000007840000001Visa
India4000003560000008Visa
Australia4000000360000006Visa
Japan4000003920000003Visa
Japan3530111333300000JCB
Singapore4000007020000003Visa

Online payments in the European Economic Area need 3D Secure under Strong Customer Authentication rules. The European cards above succeed without authentication, so also test the 3D Secure cards.

Test cards for declined payments

These cards return a card error with the error code and decline code in the table, so you can test how your integration shows a failed payment.

ResultNumberError codeDecline code
Generic decline4000000000000002card_declinedgeneric_decline
Insufficient funds4000000000009995card_declinedinsufficient_funds
Lost card4000000000009987card_declinedlost_card
Stolen card4000000000009979card_declinedstolen_card
Expired card4000000000000069expired_cardnone
Incorrect CVC4000000000000127incorrect_cvcnone
Processing error4000000000000119processing_errornone
Incorrect number4242424242424241incorrect_numbernone
Velocity limit exceeded4000000000006975card_declinedcard_velocity_exceeded

To test the incorrect CVC card, enter a CVC. If you leave the CVC out, Stripe skips the CVC check, so it can't fail.

You can't attach these decline cards to a Customer. To test a saved card that fails later, use 4000000000000341: attaching it to a Customer succeeds, and charging that customer fails.

Errors from invalid card details

You don't need a special card to test invalid details. Enter a value that is wrong:

Test cards for fraud checks (Radar)

Stripe Radar can block payments that have a high risk level or fail verification checks. Blocked payments return a card error with the code fraud. Radar always blocks the first card in the table. Whether it blocks the others depends on your Radar settings.

CaseNumberWhat happens
Always blocked4100000000000019Risk level "highest". Radar always blocks it.
Highest risk4000000000004954Risk level "highest". Radar might block it.
Elevated risk4000000000009235Risk level "elevated". Radar might queue it for review.
CVC check fails4000000000000101The CVC check fails if you enter a CVC.
Postal code check fails4000000000000036The postal code check fails if you enter a postal code.
Address checks fail4000000000000010The postal code and address line 1 checks both fail.

Test cards for disputes

With the default account settings, each of these payments succeeds and is then disputed or flagged.

DisputeNumberWhat happens
Fraudulent (asynchronous)4061219946393810Stripe creates a fraud dispute shortly after the payment, as in live mode. Stripe suggests this card for most tests.
Fraudulent (synchronous)4000000000000259Stripe creates a fraud dispute during the payment request.
Product not received4000000000002685The payment is disputed as "product not received".
Inquiry4000000000001976The payment is disputed as an inquiry.
Early fraud warning4000000000005423The payment gets an early fraud warning.
Multiple disputes4000000404000079The payment is disputed more than once.

To end a test dispute, submit evidence with one of these values, as uncategorized_text in the API or in the "Additional information" field in the Dashboard:

Test cards for 3D Secure

Only the cards in this section test 3D Secure on purpose. Other test cards can still start 3D Secure, but Stripe skips the authentication steps for them. 3D Secure redirects don't happen for payments you create in the Stripe Dashboard, so test these cards through your own checkout or the API.

CaseNumberWhat happens
Always authenticate4000002760003184Every payment needs authentication.
Authenticate unless set up4000002500003155Off-session payments need authentication until the card is set up for future payments.
Already set up4000003800000446Off-session payments succeed, and on-session payments need authentication.
3D Secure required4000000000003220The payment succeeds only after authentication.
Declined after authentication4000008260003178The payment is declined with insufficient_funds even after authentication.
Frictionless flow4000000032200000Authentication runs without a challenge and succeeds.
Not supported378282246310005The card can't use 3D Secure, so the payment goes ahead without it. This is also the American Express card from the brand table.

Test cards for refunds and your balance

With most test cards, a refund succeeds at once and doesn't change after that. The first two cards below act like live refunds, which can change status later. The third card skips the pending balance.

CaseNumberWhat happens
Refund succeeds later4000000000007726A refund starts as pending and changes to succeeded later.
Refund fails later4000000000005126A refund starts as succeeded and changes to failed after a few minutes.
Bypass pending balance4000000000000077The funds go straight to your available balance.

Stripe test bank account numbers (ACH)

For US bank account payments (ACH Direct Debit), use the routing number 110000000 with one of these account numbers:

ResultAccount numberPaymentMethod ID
Payment succeeds000123456789pm_usBankAccount_success
Account closed000111111113pm_usBankAccount_accountClosed
Insufficient funds000222222227pm_usBankAccount_insufficientFunds
Debit not authorized000333333335pm_usBankAccount_debitNotAuthorized
Dispute000555555559pm_usBankAccount_dispute

Before these payments complete, verify the test account with the microdeposit amounts 32 and 45, or the descriptor code SM11AA.

Mistakes to avoid when testing Stripe payments

For other fake data to fill a test checkout, such as names and addresses, use the fake data generator or the random address generator.

Frequently asked questions

What is the Stripe test card number?

The standard Stripe test card is 4242 4242 4242 4242, a Visa card that gives a successful payment. Use any future expiry date and any three-digit CVC.

What expiry date and CVC do Stripe test cards use?

Any future date, such as 12/34, and any three-digit CVC. American Express test cards take any four-digit CVC.

Can I use a real credit card in Stripe test mode?

No. Stripe's agreement doesn't allow testing with real card details. Use the test card numbers with your test API keys.

How do I test a declined payment in Stripe?

Use 4000 0000 0000 0002 for a generic decline, or 4000 0000 0000 9995 for insufficient funds. The table above lists the error code that each decline card returns, and the decline code where there is one.

Which Stripe test card triggers 3D Secure?

4000 0027 6000 3184 asks for authentication on every payment. 3D Secure doesn't run for payments made in the Stripe Dashboard, so test it through your checkout or the API.

Is there a Stripe test bank account number?

Yes. For ACH, use routing number 110000000 with account number 000123456789 for a payment that succeeds.

Sources