Token Vault

Test Cards vs Real Cards: What's the Difference?

Published:
November 25, 2026
Author:
Sascha Huwyler
TL;DR

A test card has the format of a real card, but it only works in a provider's sandbox, where the provider scripts the outcome. A real card is linked to an issuer account, and the issuer decides every authorization. Test cards cover most integration testing. One controlled live payment confirms what a sandbox cannot.

‍

Test cards vs real cards: what's the difference?

A test card and a real card can look identical on a checkout form. Both have a valid card network prefix, a valid length, and a correct check digit. The difference is what stands behind the number. A real card is linked to an account at a card issuer. A test card is linked to nothing but a script in a payment provider's test environment.

What is a test card?

A test card is a card number published by a payment provider for use in its sandbox, the provider's non-production environment. The sandbox recognizes the number and returns a predictable result, such as an approval, a specific decline, or a 3D Secure challenge. No money moves and no issuer is involved. Each provider publishes its own list, and a test card from one provider may not work in another provider's sandbox.

What is a real card?

A real card is a payment card issued by a bank or other card issuer and linked to a cardholder's account. When it is used, the authorization request travels from the merchant's payment service provider (PSP) through the card network to the issuer. The issuer checks the account, the available funds, and its own risk rules, and then approves or declines. Real card data is sensitive account data and must be protected under PCI DSS wherever it is stored, processed, or transmitted.

What are the differences between test cards and real cards?

The main difference is who decides the outcome. For a test card, the payment provider's sandbox decides, based on rules it publishes. For a real card, the issuer decides, based on the account and its risk models. Most other differences follow from that.

Test cardReal card
Linked toNo account; a script in a provider's sandboxA cardholder account at an issuer
Who decides the outcomeThe payment provider's sandboxThe card issuer
Where it worksOnly in the sandbox of the provider that published itIn live environments, wherever the card network is accepted
Moves moneyNoYes
Expiry date and security codeUsually any future date and any codeMust match the issuer's records
Declines and 3D SecureTriggered on purpose with specific numbers, amounts, or codesDepend on the account, the issuer, and the transaction
Data sensitivityPublic numbers; not cardholder dataCardholder data protected under PCI DSS
Card updates and network tokensSimulated, if the provider supports itReal reissues, expiry updates, and network tokens
Settlement, refunds, chargebacksSimulated in the sandboxReal funds and real disputes

Why do test cards look like real cards?

Test cards look like real cards so that every part of an integration, from the checkout form to the database, handles them the same way. A card number, or primary account number (PAN), has three parts. The first six to eight digits are the issuer identification number (IIN), also called the bank identification number (BIN), which identifies the card network and issuer. The middle digits identify the account, and the last digit is a check digit.

The check digit is calculated with the Luhn algorithm, defined in ISO/IEC 7812-1. It catches typing errors such as one wrong digit. Test cards pass the Luhn check just like real cards, so they pass client-side validation, brand detection, and length checks.

The Luhn check only proves a number is well formed. Roughly one in ten random numbers of the right length passes it, which is why a Luhn-valid number is not a card.

Testing goalUse
Form validation, input masks, brand iconsLuhn-valid numbers of each length and card network
Successful payment flowThe provider's success test card
Declines and error handlingThe provider's decline test cards, amounts, or codes
3D Secure with and without a challengeThe provider's 3D Secure test cards
Refunds, webhooks, and disputesSandbox payments plus the provider's simulation tools
Every processor and backup routeEach provider's own test cards
Final check before launchOne small live payment with a company card, then a refund

What happens when each card is used in the wrong environment?

Each kind of card only works in its own environment. A test card used on a live checkout is declined, because the authorization reaches the card network and no issuer account matches the number. A real card used in a sandbox usually fails too, because the sandbox only recognizes the numbers it has scripted.

A number that merely looks valid fails in both places. A generated, Luhn-valid number is unknown to the sandbox and has no issuer account in production. Its security code would also fail: issuers calculate the code from the card number and expiry date using secret cryptographic keys, so a made-up code will not match.

Using a real card in a test environment causes a further problem, even if no money moves. The card data ends up in test logs, databases, and error trackers that were never built to protect cardholder data. That is the main reason to keep real cards out of testing.

What can a test card not show you?

A sandbox simulates the issuer, so it cannot reproduce everything an issuer does. Test cards show that an integration handles each outcome correctly. They do not show how real issuers will behave, and some of those differences only appear in production.

The main gaps are these:

  • Decline codes. Real issuers return a wider range of decline codes than a sandbox simulates, and the same reason can arrive with different codes by card network.
  • Issuer decisions. Risk models, approval rates, and 3D Secure challenge decisions are not reproduced.
  • Authentication screens. Real 3D Secure pages are designed by each issuer and look different from sandbox pages.
  • Timing and money. Response times, settlement, and funding to the merchant's account differ from the sandbox.
  • Card lifecycle. Account updater results and network token updates are simulated at best.

This is why many teams run one controlled live payment before launch. A small payment with a company card on the production setup, refunded straight away, confirms that live credentials, routing, and settlement work. It complements sandbox testing and should not replace it.

When should developers use a test card, and when a real card?

Test cards should be used for almost all payment testing. A real card belongs in only one place: a single controlled live check before launch or after a major change.

Testing goalUseForm validation, input masks, brand iconsLuhn-valid numbers of each length and card networkSuccessful payment flowThe provider's success test cardDeclines and error handlingThe provider's decline test cards, amounts, or codes3D Secure with and without a challengeThe provider's 3D Secure test cardsRefunds, webhooks, and disputesSandbox payments plus the provider's simulation toolsEvery processor and backup routeEach provider's own test cardsFinal check before launchOne small live payment with a company card, then a refund

Our guide to 3D Secure authentication covers the authentication outcomes worth testing. Our guide to card-on-file transactions explains which stored-card flows need their own tests.

Which test card numbers can developers use?

Developers should use the test cards published by the provider whose sandbox they are testing. The numbers below are listed in the Visa Acceptance Solutions testing guide, and several also appear in other providers' documentation. All of them pass the Luhn check. What each one returns depends on the provider.

Card networkTest card numberLengthSecurity code
Visa4111 1111 1111 111116Any 3 digits
Mastercard (5-series)5555 5555 5555 444416Any 3 digits
Mastercard (2-series)2222 4200 0000 111316Any 3 digits
American Express3782 822463 1000515Any 4 digits
Discover6011 1111 1111 111716Any 3 digits
JCB3566 1111 1111 111316Any 3 digits
Maestro (UK domestic)6759 4111 0000 000816Any 3 digits

The guide accepts any expiry date after the current date. Test cards for other card networks, and the specific numbers or amounts that trigger declines and 3D Secure, should come from the provider's own documentation.

Two format details catch many integrations. American Express cards have 15 digits and a 4-digit security code. Mastercard's 2-series range, 222100 to 272099, is missed by older brand-detection rules. Detecting the brand from a maintained BIN table, as described in our article on BIN lookup, avoids both problems.

Common mistakes when testing with cards

A few habits cause most testing problems:

  • Testing with a personal card. Real card data ends up in systems not built to protect it, and the sandbox usually rejects it anyway.
  • Treating a Luhn pass as proof. A Luhn-valid number is not a card.
  • Assuming sandbox results match production. Real issuers decline more often and for more reasons than a sandbox simulates.
  • Using one provider's test cards everywhere. Each processor and backup route needs its own provider's test cards.
  • Logging full card numbers in test builds. Code that logs full test numbers will log full real numbers in production.

Test cards and real cards look the same but answer different questions. Test cards show that an integration handles every outcome. A real card, used once and carefully, shows that the live setup works.