What is a random credit card number generator?

A credit card number is the long number on the front of a card. Its first digits show the card network, such as Visa or Mastercard, and its last digit is a check digit worked out with the Luhn algorithm, which lets a form catch a typo. A random credit card number generator makes numbers that follow those rules but belong to no card. Developers and testers use them to try out checkout forms, card brand detection, input masks and number formatting, and to fill test databases.

Tool description

The page starts on credit card numbers, and the first list is ready as soon as it opens, one number per line. Set Count to how many you need, press Generate for a fresh list, then copy it or download it as a text file.

The Language list has card numbers in English, Greek, Persian and Chinese (China). It starts on the language of the page you're reading when the numbers come in it, or on English otherwise. The languages differ in their mix of brands: English has all six brands below, Greek leaves out Diners Club and JCB, Persian has only Visa and Mastercard, and Chinese (China) has Visa, Mastercard and UnionPay, whose numbers run to 16 to 19 digits without hyphens.

The card brands

Brand Starts with Digits Written as
Visa 4 13 or 16 one block of 13, or NNNN-NNNN-NNNN-NNNN
Mastercard 51 to 55, or 2221 to 2720 16 NNNN-NNNN-NNNN-NNNN
American Express 34 or 37 15 NNNN-NNNNNN-NNNNN
Discover 6011 or 65 16 NNNN-NNNN-NNNN-NNNN
Diners Club 300 to 305, or 36 14 NNNN-NNNNNN-NNNN
JCB 3528 to 3589 16 NNNN-NNNN-NNNN-NNNN

In English, each brand comes up about equally often, and every number in every language passes the Luhn check.

Test data only

  • A number that passes the Luhn check is still not a card: there's no account, expiry date or security code behind it, so it can't pay for anything.
  • A random number may match a real card by chance, so use these only in test systems.
  • For test payments, use the test card numbers your payment provider publishes, which trigger set results such as an approval or a decline.

Features

  • Card numbers in the patterns of six major brands
  • A valid Luhn check digit on every number
  • Brand mixes for English, Greek, Persian and Chinese (China)
  • Copy the list or download it as a text file
  • Runs in your browser: nothing you generate is sent anywhere