A test credit card is a card number that a payment processor publishes for sandbox testing. It passes the same format checks a live card passes (Luhn math, expiry date, CVV length) but routes to a simulator instead of a bank, so no money moves and no real account is touched. Stripe, PayPal, Braintree, Adyen and Authorize.Net each publish their own lists, and those numbers work only inside that provider's test environment.
What Is a Test Credit Card Used For?
Developers use test cards to prove a checkout flow works before it goes live. The card confirms the integration handles approvals, declines, 3D Secure prompts and refunds.
- Confirm the payment form accepts each card brand.
- Trigger a decline to test error messages.
- Test refunds, voids and partial captures.
- Check webhook delivery for each payment state.
- Run automated tests on every deploy without charging anyone.
Which Test Card Numbers Do Developers Use Most?
Stripe test cards
Stripe's documentation lists a card for every payment state. The best known is 4242 4242 4242 4242, a Visa that always approves in test mode.
- 4242 4242 4242 4242: Visa, approval
- 4000 0000 0000 0002: Visa, generic decline
- 4000 0025 0000 3155: Visa, requires 3D Secure
- 5555 5555 5555 4444: Mastercard, approval
- 3782 822463 10005: American Express, approval
Use any future expiry date and any three digit CVC. Amex needs four digits.
PayPal and Braintree
PayPal does not hand out card numbers for its classic sandbox. You create sandbox buyer accounts and sign in as the buyer instead.
Braintree publishes its own list of approval and decline numbers for its sandbox merchant accounts. A Stripe number often fails there, because routing tables differ by processor.
How Do You Read a Test Card Number?
The Luhn check
Every card number, test or live, passes the Luhn algorithm. Double every second digit starting from the right, subtract 9 from any result above 9, then add all digits. If the total divides by 10, the number is valid.
Gateways run this check before they touch a card network. A typo in a test number fails Luhn and returns a format error, not a decline.
Issuer identification numbers
The first digits tell the gateway which brand to route to.
- 4: Visa
- 51 to 55, or 2221 to 2720: Mastercard
- 34 or 37: American Express
- 6011, 644 to 649, 65: Discover
What Do Declined Test Cards Show?
Processors publish a decline card for each reason code, so you can see the exact message a customer would get.
- Generic decline, the catch-all failure
- Insufficient funds
- Expired card
- Incorrect CVC
- Processing error
- Lost or stolen card
Test each one and confirm your interface shows a message a human can act on. "Card declined" alone tells the buyer nothing.
How Do You Add Test Cards to Your Workflow?
- Switch your API keys from live to test mode.
- Load the provider's test card list into your fixtures.
- Write cases for approval, each decline, and 3D Secure.
- Check that webhooks and order records update for every case.
- Repeat the suite in CI on each deploy.
Keep test cards out of production configs. A stray test key in a live build creates support tickets that take hours to untangle.
What Are the Rules for Using Test Cards?
Test cards work only in sandbox mode. Running a published test number against a live gateway is card testing, and processors treat it as fraud.
- Never send test numbers to a live endpoint.
- Never mix test and live API keys in one environment.
- Do not invent numbers and call them valid cards.
- Rotate test keys the same way you rotate live ones.
Card testing attacks, where a script fires thousands of numbers at a checkout form, look the same on the wire as a careless test run. Rate limits and CAPTCHAs protect your live form either way.
Are Free "Working Card Number" Lists Legit?
No. Lists marketed as valid cards with CVVs are either stolen data or bait for a scam.
A test card is not a real card and cannot buy anything. Real card data never appears in public lists, and anyone selling it is breaking the law. If a page promises live cards for free, it wants your money, your data, or both.
Frequently Asked Questions
Do test credit cards charge money?
No. They route to a simulator. Your test dashboard shows a payment record and no funds move.
Can I use a test card on a real store?
No. Live gateways reject the number or flag the attempt, and repeated tries can get your merchant account shut down.
What expiry date should I use?
Any date in the future works in test mode. Providers often accept a placeholder such as 12/34.
Why does my test card get declined?
Check the mode of your API key first. A decline in test mode means you picked a card that is built to decline.
Are test cards the same across providers?
No. Each processor publishes its own list, and a number from one sandbox often fails in another.