Developer ToolsOctober 17, 20265 min readAuthor: Admin MondayTool

Test Card Numbers for Sandbox Testing: How to Use Them

Free test card numbers with expiry and CVV for your payment gateway sandbox. See which numbers to use, what Luhn means and why real cards must never be used.

Open Test Card Generator
Test card numbers generated for sandbox payment testing

If you build a checkout, sooner or later you need a card number to test it with. You cannot use a real card, and typing random digits fails the first validation check. Test card numbers solve this: they look like real cards, but they only work inside a payment gateway sandbox, where no money moves.

I made the MondayTool Test Card Generator for this one job: give a developer a quick set of test cards to try on their own sandbox account. This guide explains what test cards are, how to use them and what to watch out for.

Why I built this tool

The test card generators I used on other sites had a limit. After a few uses they asked me to sign up or wait. When you are testing a form many times in a day, that gets in the way. I wanted a page that just works, so this tool has no sign-up and no daily limit. You can generate as many sets as you need, up to 100 records each time.

What a test card number is

A test card number is a card number that a payment gateway recognises as fake. In the sandbox it behaves like a card, so you can walk through the whole payment flow, but it is never charged. These numbers are not tied to a real bank account or a real person.

A sandbox is a separate test copy of the gateway. It has its own keys, and a number that works there will not work on the live account.

What the generator gives you

  • Seven card types: Visa, Mastercard, American Express, Discover, Diners Club, JCB and UnionPay.
  • A test card number shown in the correct grouping for that type, for example 4 4 4 4 for Visa and 4 6 5 for American Express.
  • An expiry date set one to six years ahead, so it is always in the future.
  • A CVV and a CVV2. These are three digits, and four digits for American Express.
  • A made-up name for each record, so you can fill the name field too.

One thing to be clear about: the card numbers are not created at random. For each card type the tool picks from a list of well-known test numbers, such as the Visa number 4242 4242 4242 4242. The expiry date, security code and name are what change from record to record.

How to use it

  • Open the Test Card Generator and pick a card type, or choose All card types.
  • Set how many records you want, from 1 to 100.
  • Click Generate.
  • Use Copy text for a quick paste into a form, or Copy CSV if you want the records in a spreadsheet or a test script.
  • Use Save to history if you want to come back to a set later. History stays in your own browser.

Then paste the number, expiry and CVV into the card form of your sandbox checkout and run the payment.

What Luhn validation means

Most card numbers follow a simple checksum called the Luhn algorithm. It catches typing mistakes, such as a wrong or swapped digit. A checkout form often runs this check before it even contacts the gateway.

The numbers in this tool pass the Luhn check, so they get through your form validation. Passing Luhn does not mean a number is a real card. It only means the digits are consistent.

Use your gateway sandbox, and its own test cards for special cases

Payment gateways such as Stripe, Braintree, PayPal and Authorize.net publish their own test numbers. Some of those numbers are made to trigger a specific result, like a declined card or a card that needs extra authentication. That behaviour is set by each gateway, so a number from any generator will not trigger it.

  • Use this tool for the normal flow: form validation, card type detection, formatting, expiry and CVV fields, and the success path.
  • Use the gateway's own documentation when you need to test a decline, a fraud check or 3D Secure.
  • Use your sandbox keys, not live keys, so that nothing real can be charged.

Test numbers, expiry rules and CVV rules can differ between gateways, so check the current list in your gateway's documentation before you rely on a number.

Mistakes to avoid

  • Do not enter a real card number in a sandbox. Sandboxes reject real cards, and you should never share real card details in test tools.
  • Do not use sandbox keys on your live site, or live keys in your tests.
  • Do not treat a Luhn-valid number as a working card. It only passes the checksum.
  • Do not use generated numbers to try to buy anything. They are for testing only and will not work on a real payment.

Frequently asked questions

Are these real credit card numbers?

No. They are test numbers for sandbox and form testing. They are not linked to any bank account and cannot make a real payment.

Will these cards work on my live payment page?

No. Test numbers work only in a gateway sandbox. A live page will decline them.

Is there a limit on how many cards I can generate?

You can generate up to 100 records at a time, and you can generate again as often as you like. There is no sign-up and no daily limit.

Which expiry date and CVV should I use?

Use the ones the tool shows. The expiry is always in the future. Many sandboxes accept any future date and any valid-length CVV, but check your gateway's documentation, because some require specific values.

Why does my gateway still decline the card?

Check that you are using sandbox keys, and that the number is on your gateway's accepted test list. Some gateways accept only their own published numbers.

Is my data sent anywhere?

The records are made in your browser. If you use Save to history, it is stored in your own browser, not on a server.

If you test forms often, you may also like the other developer tools on MondayTool, such as the JSON Formatter and the Password Generator.

Ready to try it?

Open the tool, follow the steps above, and use the final result in your US marketplace, website, document, report, or personal workflow.

Use Test Card Generator

Related Articles

View all