Developer Tools

Test Credit Card Numbers

Test card numbers for Stripe, PayPal, Square, and Braintree. Organized by brand and success/failure pattern, with one-click copy. Use during payment implementation and testing.


[[ labels.stripe_hint ]]
Service [[ labels.col_number ]] [[ labels.col_brand ]] [[ labels.col_behavior ]]
[[ card.service ]] [[ formatNumber(card.number) ]] [[ card.brand ]] [[ labels['subtype_' + card.subtype] ]] [[ behaviorLabel(card.behavior) ]]

Tips

  • In Stripe test mode, any 3-digit CVC (4 digits for Amex), any future expiry date, and any 5-digit zip code will pass. No real charge occurs unless you use a live key.
  • All test card numbers are designed to pass the Luhn check (card number validation algorithm). This lets you reproduce gateway test scenarios without being rejected by front-end validation.
  • For 3D Secure (3DS) testing, use dedicated cards. 4000002500003155 triggers the authentication dialog, and 4000000000003220 is used for the 3DS 2 flow.
  • Using test card numbers in production will result in a declined transaction. Always pair test keys with test card numbers. For Stripe, test keys start with sk_test_.

FAQ

As long as you use them with test keys (such as sk_test_), no real charge will occur. If you accidentally use a live key, the transaction will be attempted even with test card numbers, so be careful not to mix them up.

For Stripe, any digits work for CVC (3 digits for Visa/Mastercard, 4 for Amex), any future date for expiry (e.g. 12/34), and any 5-digit zip code. PayPal, Square, and Braintree sandbox environments similarly do not strictly validate these values.

It is a formula that verifies whether a card number's digits and arrangement are valid. Every second digit from the right is doubled and all digits are summed; if the total is a multiple of 10, the number is considered valid. It catches most typos but cannot verify whether a card actually exists.

"4242..." is easy to remember as a repeating sequence and is designed to pass the Luhn check. Stripe's use of this number in their official documentation for many years made it the de facto standard among payment developers.

Side Note — The Luhn Algorithm — The Guardian of Card Numbers Since 1954

The "check digit" at the end of a credit card number is validated by an algorithm invented in 1954 by IBM engineer Hans Peter Luhn. Every second digit from the right is doubled, all digits are summed, and the result must be divisible by 10. This simple check is still used by major brands including Visa, Mastercard, and Amex, and catches the vast majority of accidental typos.

However, the Luhn check is purely designed to detect digit errors — it does not verify whether a card actually exists. Using the Luhn check in client-side form validation is purely a UX improvement (instant error feedback) and does nothing to prevent fraud. Real authorization must always be performed server-side through a payment gateway.

Test card numbers are fixed numbers that each payment service has deliberately designed to pass the Luhn check. For example, Stripe's 4242424242424242 is easy to remember and passes Luhn validation. The number itself has no inherent meaning — it is simply mapped to a behavior (e.g., "success" or "failure") within Stripe's system.