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.
| 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.
4000002500003155triggers the authentication dialog, and4000000000003220is 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
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.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.