Choose a card type
How many?
1

Test data only. Local fixtures do not issue cards, verify accounts or provide payment authorization. Use them only in authorized tests. Why?

VisaTEST CARD
•••• •••• •••• ••••
Cardholder—
ExpiresMM/YY
CVV•••
  • Generated fields are not uploaded
  • Randomly generated in your browser
  • Every number passes the Luhn check

Choose a fixture for the question you are testing

This tool creates synthetic numbers, expiry fields, security codes and placeholder names for local form tests. The practical choice is which input will expose your defect: a brand transition, a length boundary, a malformed value, an export conversion or a gateway response. Those jobs need different fixtures.

What you need to testUseExpected evidence
A form populated with one or several brandsThe generator aboveLabels, grouping and synthetic fields render correctly
Malformed input, prefix ambiguity or length boundariesThe shared validation bundle belowSeparate expected results for characters, prefix, length and checksum
A specific prefix and total digit countPrefix generatorThe generated number retains the requested shape
A larger seeded datasetBulk generatorThe export matches that tool’s separate schema and recorded settings
Gateway approval, decline or authenticationHomepage scenario selectorRequired inputs and documented expectations for selected Stripe and PayPal tests

Use the generator controls

  1. Choose a network tile, or use the Card type menu on mobile. The page starts with a generated Visa example. Mixed selects from Visa, Mastercard, Amex and Troy.
  2. Choose 1–25 records with the quantity controls. Changing the network or quantity generates a fresh set; it does not preserve the previous one.
  3. Use Generate new card or Generate N cards for another random batch. Repeated values are possible, and a mixed batch does not guarantee coverage of every brand.
  4. For a single result, copy individual fields or all details. For multiple results, choose List, JSON or CSV before copying the batch. JSON and CSV download buttons save files; changing the preview format does not regenerate the values.

What this tool actually emits

NetworkConfigured prefixesLengths
American Express34, 3715
Diners Club300–305, 36, 38, 3914
Discover6011, 65, 644–64916
JCB3528–358916
Maestro50, 56–58, 6304, 6759, 6761–676316, 19
Mastercard51–55, 2221–272016
Troy979216
UnionPay62, 8116, 19
Visa416

Every generated number has a calculated Luhn check digit. The security code is a random string of the configured length, not a code derived from the number. Expiry years are chosen one to five calendar years ahead of generation, so save an export when exact fixture values matter.

There is no per-prefix or per-length selector here. The length comparison shows the generator’s subset next to the wider local validation profile. Neither table promises what a merchant accepts.

Preserve the export contract

JSON contains network, type, number, formattedNumber, expirationMonth, expirationYear, cvv, cardholderName and status. A single record is an object; multiple records are an array. number is unformatted; formattedNumber is for display. The status text is “Test card only,” not an account or authorization status.

CSV uses the headers Card type, Card number, Expiration month, Expiration year, CVV/CVC, Cardholder name and Status. Keep the numeric-looking values as text when importing them, particularly leading-zero security codes and long identifiers. The Visa round-trip exercise demonstrates that failure directly.

Reuse the fixed checks alongside random output

Extract the shared format-check bundle and run:

node --test card-validation.test.mjs luhn.test.mjs

These tests use the same profile that supplies this generator’s rules and the number validator. They verify generator prefix endpoints and output lengths, then exercise additional fixed controls that the generator will not emit, including wrong checksums, unsupported lengths and embedded letters.

Use the Amex transition cases when switching brands breaks a security-code field. Use the Mastercard boundary cases when a range endpoint is misclassified. These focused exercises produce a clearer failure than generating a large random batch and hoping the relevant condition appears.

Run a local check with a known outcome

The random generator is useful for input variation. This fixed check demonstrates a specific difference: a passing number and a one-digit typo have the same brand, but opposite checksum results.

Extract the validation bundle above and run node quickstart.mjs with Node.js 22 or later. No API key, payment SDK or network request is needed. The command prints both results and exits unsuccessfully if an assertion fails.

import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import { inspectCard } from './card-validation.mjs';

const read = name => JSON.parse(readFileSync(new URL(name, import.meta.url), 'utf8'));
const profile = read('card-profiles.json');
const cases = read('card-validation-cases.json').cases;
const original = cases.find(row => row.id === 'visa-4-16').input;
const typo = original.slice(0, -1) + ((Number(original.at(-1)) + 1) % 10);

for (const [label, input, expected] of [
  ['original', original, 'pass'],
  ['one-digit typo', typo, 'fail'],
]) {
  const result = inspectCard(input, profile);
  assert.equal(result.status, 'ok');
  assert.equal(result.brand, 'visa');
  assert.equal(result.lengthState, 'supported');
  assert.equal(result.checksum, expected);
  console.log(JSON.stringify({label, brand: result.brand, checksum: result.checksum}));
}

Run node --test quickstart.test.mjs to exercise the same example in the shared suite.

Keep random values out of the acceptance decision

A generated number is useful because its shape is controlled. It does not establish an issued card, a usable security code, an issuer country or available funds. Save the synthetic input that reproduces a bug, record the expected local result and retest that case after a fix. Test gateway outcomes separately with its documented sandbox inputs.

Frequently Asked Questions

Does Mixed include all nine networks?
No. Mixed selects from Visa, Mastercard, American Express and Troy. Select the other networks individually. Random selection does not guarantee every selected brand appears in one batch.
Does the generator emit every length in the validation guide?
No. The output table on this page describes what it emits. The shared validation profile includes additional lengths, which are covered by separate fixed fixtures or the prefix generator.
Are the exported fields the same as the bulk generator’s?
No. This tool uses fields such as number and expirationMonth; the bulk generator uses a separate schema. Read the schema for the tool you exported from rather than interchanging the files blindly.
Which test inputs should I use for gateway responses?
Use your provider’s published sandbox fixtures and test environment. Numbers generated here exercise local shape and UI behavior; they do not define gateway approvals, declines or authentication results.