What test credit card numbers are and why they exist
Test credit card numbers are fake card numbers that payment processors and online retailers use to check whether their checkout systems work correctly without charging real money. They follow the same format rules as genuine cards — they have the right number of digits, pass the Luhn algorithm check that validates card numbers, and trigger specific responses in test environments — but they are not connected to any actual bank account or cardholder.
Payment companies like Visa, Mastercard, American Express, and Discover publish these numbers so that developers, merchants, and QA testers can verify that their systems process payments, handle errors, and display confirmation screens the way they should. When you use a test number in a sandbox environment (a separate, non-live version of a website or app), the transaction does not go through to a real bank and no money changes hands.
Test numbers are not a way to make free purchases on real websites. Legitimate retailers' live checkout systems reject test numbers when ready. They are only useful in development and testing environments that are explicitly set up to accept them.
Key Takeaways
- Test credit card numbers are fake numbers used only in sandbox environments to check whether payment systems work without charging real money.
- Each major card brand publishes its own set of test numbers that follow real card formatting rules but are not connected to any bank account.
- Test numbers work only in development and testing environments; live retail websites reject them when ready.
- Different test numbers can be used to simulate different outcomes — successful charges, declined cards, and specific error messages.
- You should never attempt to use test numbers on a real website's checkout, as this violates the site's terms of service and may trigger fraud alerts.
Where each major card brand publishes its test numbers
Visa publishes test card numbers on its developer portal at developer.visa.com. You can find them under the Testing section, organized by card type (Visa, Visa Electron, Visa Debit). The most commonly used Visa test number is 4111111111111111, with an expiration date of any future month and year, and a CVV of any three digits.
Mastercard hosts its test numbers at developer.mastercard.com under the Testing Resources section. The standard Mastercard test number is 5555555555554444, also with any future expiration date and any three-digit CVV.
American Express publishes test numbers on its developer site at developer.americanexpress.com. The test Amex number is 378282246310005, again with any future expiration and any four-digit CVV (Amex cards have four-digit security codes instead of three).
Discover's test numbers are available at developer.discover.com. The standard Discover test number is 6011111111111117, with any future expiration date and any three-digit CVV.
How test numbers simulate different payment outcomes
Payment processors use specific test numbers to trigger different responses in sandbox mode. A successful charge typically uses the standard test number for each card brand. If you enter an expiration date in the past, the system simulates a card that has expired. If you use certain reserved test numbers, the processor returns a "declined" response without actually attempting to charge anything.
For example, Visa reserves 4000000000000002 to simulate a declined transaction. Mastercard uses 5105105105105100 to simulate a successful charge and 5200828282828210 to simulate a declined card. These variations let developers test how their checkout pages handle errors, display decline messages, and prompt customers to try a different payment method.
Some payment gateways also use specific amounts to trigger different responses. Entering $0.00 might return a success, while $0.01 might trigger a decline. Always check the documentation for the specific payment processor or sandbox you are using, because the rules vary between Stripe, Square, PayPal, and other platforms.
Where you can actually use test card numbers
Test numbers work only in sandbox environments, which are separate copies of websites or apps built specifically for testing. If you are a developer building an e-commerce site, you can use test numbers in your local development environment or in your payment processor's sandbox portal to verify that your checkout flow works before you go live.
If you are a QA tester or merchant employee, your company's internal testing environment will have a sandbox mode that accepts test numbers. Your payment processor's dashboard often includes a sandbox section where you can log in and process test transactions to confirm that webhooks, refunds, and other backend functions work correctly.
Some payment processors and shopping platforms offer free sandbox accounts specifically so that developers and merchants can test without risk. Stripe, for instance, provides a free sandbox mode where you can process unlimited test transactions. Square, PayPal, and Shopify all offer similar testing environments.
Why test numbers do not work on real websites
Live retail websites and payment processors are configured to reject test card numbers when ready. The checkout system checks whether the card number is in the test range and blocks the transaction before it ever reaches the bank. This is a security feature — it prevents fraud, stops accidental test transactions from going through on live sites, and ensures that only real payment methods are processed.
If you attempt to use a test number on a real website's checkout, the system will either decline the transaction silently or display an error message like "Card number is invalid" or "This card cannot be processed." Some sites may also flag repeated test number attempts as suspicious activity and temporarily lock your account or trigger a fraud review.
Attempting to use test numbers on a live website also violates the terms of service of most retailers and payment processors. It is not illegal, but it can result in account suspension or other consequences depending on the site's policies.
Common test scenarios and what numbers to use
If you are testing a checkout system and need to simulate a successful transaction, use the standard test number for the card brand you are testing: 4111111111111111 for Visa, 5555555555554444 for Mastercard, 378282246310005 for American Express, or 6011111111111117 for Discover. Pair any of these with a future expiration date and any valid CVV.
To test a declined card scenario, use the reserved decline numbers: 4000000000000002 for Visa or 5200828282828210 for Mastercard. The system will return a decline response without attempting to charge anything, letting you verify that your error handling and retry logic work correctly.
To test an expired card, use any standard test number but enter an expiration date in the past — for example, 01/20 if the current date is after January 2020. To test an invalid CVV, enter a test number with an incorrect security code (a two-digit code instead of three, or a letter instead of a number). Different payment gateways handle these scenarios differently, so always check your processor's documentation for the exact test numbers and amounts they support.
Frequently Asked Questions
Can I use test card numbers to make real purchases?
No. Test numbers are rejected by all live retail websites and payment processors. They work only in sandbox environments that are explicitly configured for testing. Attempting to use them on a real checkout will fail and may trigger fraud alerts on your account.
Do test card numbers charge my real bank account?
No. Test numbers are not connected to any real bank account or cardholder. Transactions processed with test numbers in sandbox mode do not result in any charges, even if the transaction appears to succeed in the test environment.
Where can I find test numbers for payment processors other than the major card brands?
Payment gateways like Stripe, Square, PayPal, and Shopify publish their own test numbers and sandbox documentation on their developer portals. Check the "Testing" or "Sandbox" section of the processor you are using. Many also provide test numbers for specific scenarios like 3D find authentication or recurring billing.
What happens if I accidentally use a test number on a real website?
The transaction will be declined, and no charge will go through. The website may display an error message or ask you to try a different payment method. Repeated attempts with test numbers might trigger a fraud review, but a single accidental use will not cause lasting problems.
Are test card numbers the same across all payment processors?
No. While the major card brands (Visa, Mastercard, Amex, Discover) publish standard test numbers that work across most processors, individual payment gateways may use additional or different test numbers for their own sandbox environments. Always check the documentation for the specific processor you are testing with.