BYTETOOLS

Test Credit Card Number Generator

Generate fake but format-valid card numbers for QA testing. Real issuer prefixes, a correct Luhn check digit, fake expiry and CVV, plus one-click CSV export.

These are fake numbers for testing only. They pass a format check because the check digit is calculated correctly, but they are not linked to any bank account and will never authorise a payment. Using a card number you do not own to attempt a real transaction is fraud.

Each number starts with a real issuer prefix, fills the middle with random digits and closes with a Luhn mod-10 check digit, then is re-validated before it is shown. Everything is generated in your browser with crypto.getRandomValues() — nothing is sent to a server. For end-to-end payment testing, prefer the sandbox card numbers your payment provider publishes, because those trigger specific approval and decline scenarios.

What is the Test Credit Card Number Generator?

This generator builds card numbers that are structurally correct but completely fake, which is exactly what you need when testing a checkout form.

  • Real IIN prefixes for six major card brands
  • Correct Luhn mod-10 check digit on every number
  • Matching fake expiry date and CVV length per brand
  • Every number re-validated before it is shown
  • Brand-correct digit grouping for display and copy
  • CSV export with brand, expiry, CVV and check status

How to use the Test Credit Card Number Generator

  1. 1

    Choose a card brand, or select Mixed brands to get a spread.

  2. 2

    Set how many numbers you want, up to 200 at a time.

  3. 3

    Press Generate test numbers and check the Luhn column reads Pass.

  4. 4

    Toggle digit grouping if you want spaces when you copy.

  5. 5

    Copy the numbers, or download the full table as CSV.

About the Test Credit Card Number Generator

This generator builds card numbers that are structurally correct but completely fake, which is exactly what you need when testing a checkout form. Each number begins with a genuine issuer prefix, fills the middle with random digits and finishes with a Luhn mod-10 check digit, so it passes the client-side validation that payment forms run before submitting.

These numbers are not linked to any bank account and will never authorise a payment. They are syntactically valid only. Using a card number you do not own to attempt a real transaction is fraud, and for end-to-end payment testing you should always prefer the sandbox numbers your payment provider publishes, since those trigger specific approval and decline scenarios.

Choose Visa, Mastercard, American Express, Discover, JCB or Diners Club, or mix them, and pick how many you need. Every number is re-validated against the Luhn algorithm before it appears. Everything is generated in your browser with the cryptographic random source, and nothing is uploaded.

Frequently asked questions

Can these test card numbers be used to buy anything?

No. They only satisfy the format rules that a card number must follow. There is no account, no balance and no issuer record behind them, so any real payment attempt is declined immediately.

What is the Luhn algorithm?

It is a simple checksum that catches most typos in a card number. Starting from the right, every second digit is doubled, digits above nine have nine subtracted, and the total must divide evenly by ten. Nearly every payment form checks it before submitting.

Why does my payment gateway reject these numbers?

Because gateways check far more than the format — they verify the card exists with the issuer. These numbers only pass front-end validation. For gateway testing, use the sandbox card numbers your provider documents.

Could a generated number belong to a real person by accident?

The middle digits are random, so a collision with a live account is theoretically possible but vanishingly unlikely, and the number would still fail every other check an issuer runs. Never attempt a real transaction with one.

Why do Amex numbers have 15 digits and a 4-digit CVV?

American Express uses a 15-digit number with a four-digit code printed on the front of the card, while Visa, Mastercard and Discover use 16 digits with a three-digit code on the back. The tool follows each brand's real rules.

Related tools