A valid credit card test number is a fake card number that a payment processor publishes for sandbox testing. It passes the Luhn checksum and looks like a real card, but it is tied to a test account and never reaches a bank. Use the numbers your own processor documents, and use them only in test mode.

valid credit card test number

What a Test Card Number Actually Is

A test card number is a placeholder credential. The issuing bank behind the number range does not exist in the live network, or the number is blocked from real authorization. Processors map each test number to a scripted outcome, so one number always succeeds, another always declines, and a third triggers a specific error such as insufficient funds or an expired card.

credit card test number for beginners

Because the outcome is scripted, a test number tells you nothing about a real cardholder account. It cannot verify whether a live card is open, funded, or stolen.

what is a credit card test number

Prerequisites

  • A sandbox or test account with a payment processor
  • Test API keys for that environment
  • A checkout page or API client pointed at the sandbox endpoint

How to Test a Card Number

  1. Open your processor dashboard and switch the account to test mode.
  2. Find the published test card list for your processor and region.
  3. Copy a success card number, such as 4242 4242 4242 4242.
  4. Enter any future expiry date, for example 12/34.
  5. Enter any three digit CVC value. Use four digits for American Express test numbers.
  6. Submit the transaction through your sandbox checkout.
  7. Read the response code and the raw API response in your dashboard.
  8. Repeat the run with a decline number and an error number to confirm each branch of your code.
  9. Clear the sandbox data between test cycles so old tokens do not mask new failures.

Common Test Numbers

  • Visa success: 4242 4242 4242 4242
  • Visa decline: 4000 0000 0000 0002
  • Visa insufficient funds: 4000 0000 0000 9995
  • Mastercard success: 5555 5555 5555 4444
  • American Express success: 3782 822463 10005

Lists differ between processors and between countries. Always use the list published for the account you are integrating, since a number that succeeds in one sandbox may return an unknown card error in another.

related article

What Test Numbers Cannot Do

A test number cannot buy goods, confirm that a live card is open, or check a balance. Live card numbers, expiry dates, and CVV values belong to the cardholder. Card network rules and laws such as the US Computer Fraud and Abuse Act restrict how that data may be stored, transmitted, and used, and the PCI Data Security Standard sets the technical controls for any system that touches it. Running live cardholder data through a non-compliant test environment is a breach of those rules, not a shortcut.

Common Mistakes

  • Leaving live keys in the test environment, which turns a harmless test run into a real charge attempt.
  • Assuming one processor's success number works on another processor's gateway.
  • Testing only the success path and never the decline, 3D Secure, or timeout branches.
  • Storing test numbers in the same database table as live tokens without a clear environment flag.