Guide

Test Card Numbers: Visa and Mastercard Guide

Learn how to use test card numbers for Visa, Mastercard, and other brands. Test approvals, declines, refunds, expiry dates, and webhooks safely.

Editorial Team 6 min read
Test Card Numbers: Visa and Mastercard Guide

Understanding Test Card Numbers

Test card numbers are fake values made for payment testing. They let you run checkout flows without real card details.

They work only in a sandbox or test mode. A sandbox is a safe copy of your payment setup. It does not move real money.

These values help you test payments, refunds, records, and webhooks. A webhook is an automatic message sent after a payment event.

Many test values pass the Luhn Mod 10 algorithm. This check finds basic number errors. Passing it does not make a card real.

Never use test card numbers in live mode. Never use real customer data during development. Keep test keys and live keys apart.

List of Test Card Numbers

The table below shows common values from Stripe's test setup. Other payment tools may use different values. Check your tool's own guide first.

Card brandTest numberSecurity codeExpiry date
Visa4242 4242 4242 4242Any three digitsAny future date
Mastercard5555 5555 5555 4444Any three digitsAny future date
American Express3782 822463 10005Any four digitsAny future date
Discover6011 1111 1111 1117Any three digitsAny future date
JCB3530 1113 3330 0000Any three digitsAny future date

The Visa value is often called a Visa test card. It supports a basic approved payment in many sandboxes.

Some forms reject spaces. Others add spaces for display. Enter digits in the format your form expects.

For more approved values and test results, see Stripe's testing guide. Stripe lists values for approvals, declines, and other events.

Blank payment tokens arranged beside a green transaction routing path
Payment token routing concept

Visa Terms You May See During Testing

If you ask “what is a visa card,” the short answer is simple. It is a payment card that uses the Visa network.

The meaning of visa card does not tell you who issued it. A bank or credit union issues the card. Visa helps route the payment between that bank and the seller.

Visa Inc is the company behind the Visa payment network. It does not usually lend money to card users. The issuer sets your limit, rate, rewards, and account rules.

So, what is visa credit? It means credit offered on a Visa-branded card. A debit card can also use Visa. The funding source makes the key difference.

People often ask, “what is better visa or mastercard?” Neither network wins in every case. Fees, rewards, support, and acceptance depend more on the issuer and card product.

Visa Secure adds a sign-in check during some online payments. Visa verification can confirm that the buyer is the real card user.

Is visa secure legit? Yes. It is a real Visa service used by banks and sellers. The exact check may ask for a bank app approval or a one-time code.

VisaNet is Visa's global payment network. It routes payment data between approved banks and sellers. For background, see Visa's company overview.

How to Use Test Card Numbers

Start by switching your payment tool to sandbox mode. Confirm that your keys, account, and callback links belong to testing.

Then open your checkout flow and enter one test value. Use a future expiry date, such as 12/30. Use an allowed security code.

Use a small test amount first. For example, enter 5.00 in your chosen currency. The sandbox keeps that payment away from real funds.

Follow this credit card testing process:

  1. Set the payment account to test mode.
  2. Load the test checkout page.
  3. Enter a listed test card number.
  4. Add a future expiry date and valid test code.
  5. Submit the payment and review the result.
  6. Check the payment record, receipt, and webhook event.

Test the full path, not just the payment button. Check loading states, error messages, saved records, and email alerts.

Keep the test result tied to a clear case name. This makes failed runs easier to repeat.

Simulating Approved and Failed Payments

A good transaction simulation covers more than one successful payment. It checks how your system handles failed steps.

Use processor-specific test values when possible. Some tools use special amounts or codes to trigger a result. A random value may cause a normal decline instead.

  • Approved payment: Use the standard success value.
  • Generic decline: Use the listed decline value.
  • Wrong security code: Use the failed code case.
  • Expired card: Use a past expiry date when supported.
  • Insufficient funds: Use the matching test case.
  • Processing error: Test a delayed or failed reply.
  • Authentication step: Test a required buyer check.

Record the result returned by the payment tool. Then check your app's customer message.

Do not show raw payment errors to shoppers. Give a short next step, such as trying another card.

Abstract branching paths showing payment approval and failure testing
Payment outcome testing paths

Testing Expiry Dates, Amounts, and Currencies

Expiry checks need their own test cases. Use a past month for an expired-card case. Use the current month for edge rules.

Most sandboxes accept any future month and year. Some require a date within a set range. A future date does not prove live funds exist.

Test amounts should match your business rules. Try a small order, a zero value, a refund, and your largest allowed order.

  • Test the smallest accepted payment.
  • Test the largest allowed payment.
  • Test a payment with decimal cents.
  • Test a refund larger than the payment.
  • Test each supported currency.

Currency-specific testing can reveal rounding bugs. It can also expose rules that work in one market only.

Check the amount shown at each stage. The checkout, payment record, receipt, and refund should match.

Payment Processor Setup and Safety

Test values work only when the payment tool is set up correctly. Check the mode before every test run.

Use separate settings for test and live accounts. Mark test orders clearly in your database. Remove test data before launch.

Also check callback links and event handling. A payment can look successful while your order record stays open.

  • Use test keys in local and staging environments.
  • Block live keys from test builds.
  • Check the payment status on the server.
  • Verify refund and dispute event handling.
  • Review logs for private card data.
  • Run one live payment only after launch checks pass.

Do not try test credit card numbers against a real store. That can trigger fraud checks or unwanted charges.

When the setup is sound, test card numbers make payment work safer. They show where checkout, records, messages, and refunds need change.

Step-by-step

  1. 01
    Turn on sandbox mode

    Switch your payment account to test mode. Confirm that every key and callback link is for testing.

  2. 02
    Open the test checkout

    Load the checkout page in your test environment. Check that the order has a clear test marker.

  3. 03
    Enter a test value

    Use a listed test card number, future expiry date, and allowed security code.

  4. 04
    Submit a small payment

    Run a small payment first. Confirm that no real account receives a charge.

  5. 05
    Check payment events

    Review the payment record, receipt, and webhook event. Match each result to the right order.

  6. 06
    Run failed cases

    Test declines, wrong codes, expired dates, refunds, and other cases your tool supports.

Frequently asked questions

What are test card numbers?
Test card numbers are fake values for sandbox payments. They do not move real money.
What is a Visa test card?
A Visa test card is a sandbox value that acts like a Visa payment. It helps test checkout flows without real funds.
What is a Visa card?
A Visa card is a debit or credit card that uses the Visa payment network. A bank or credit union usually issues it.
What is better, Visa or Mastercard?
Neither network is always better. The issuer, fees, rewards, and acceptance matter more for most buyers.
Is Visa Secure legitimate?
Yes. Visa Secure is a real service that helps banks check online card payments.
How do I use test card numbers safely?
Turn on sandbox mode first. Then use the values from your payment tool and keep test keys separate.
test card numbersvisa test cardtest credit card numberspayment processor testingcredit card testing processtransaction simulationpayment error conditionscurrency testing

Related reading