What CC Generator is

CC Generator is a free, browser-based tool that produces synthetic payment card data for software testing. It generates card numbers that satisfy the Luhn checksum and match the published length and prefix rules of eight card networks, along with matching expiry dates, CVV values, and cardholder names. It is built for the people who have to make card input work correctly — engineers building checkout flows, QA engineers testing them, and anyone teaching how card numbers are structured. Nothing it produces is a real card, and nothing it produces leaves your browser.

Why we built it

Anyone who has built a payment form runs into the same wall.

You need to test card input. Not the payment itself — the input. Does the field mask correctly as digits are typed? Does it detect Visa from the first digit and switch the logo? Does it reject fifteen digits for a network that requires sixteen, and accept fifteen for American Express? Does your CSV export escape the field, and does your log scrubber redact it?

You cannot use a real card for this. Beyond the obvious security problem of scattering your own card number through test fixtures, git history, and CI logs, PCI DSS is explicit: live primary account numbers must not be used for testing or development. That rule exists precisely to keep production cardholder data out of non-production environments. Synthetic test data is not a convenience here — for anyone in scope of the standard, it is a compliance requirement.

Gateway sandbox cards only get you so far. Stripe, Adyen, PayPal and the rest publish test numbers, and they are the right tool for testing processor behaviour. But each list is short and fixed: a handful of numbers on one or two networks, each wired to a rehearsed outcome. If you need forty Mastercards to seed a fixture, a Diners Club number to check your 14-digit path, or a 19-digit Maestro to find where your column width breaks, the sandbox list does not have them.

That gap is what this tool fills. It sits earlier in the cycle: use it while you are testing your own code, then switch to your provider’s official test cards once you are testing theirs.

How the generator works

No black box. Here is exactly what happens when you press Generate.

Network rule selection

Every card network owns ranges of Issuer Identification Numbers (IINs, often still called BINs) and specifies how long a full account number may be. The generator holds one rule per network:

NetworkPrefixesLengthCVV
Visa4163
Mastercard5155, 22212720163
American Express34, 37154
Troy9792163
Discover6011, 65, 644649163
JCB35283589163
Diners Club300305, 36, 38, 39143
Maestro50, 566916 or 193

Pick a network and the generator selects one prefix from its range and one permitted length. (The standards allow more variation than this — ISO/IEC 7812 permits PANs up to 19 digits, and Visa has historically issued 13- and 19-digit numbers — but these are the combinations the tool emits, chosen because they are what payment forms actually encounter.)

Random digit generation

The digits between the prefix and the check digit are filled with uniform random values from the browser’s built-in generator, Math.random(). This is a fast pseudorandom source, not a cryptographically secure one — and deliberately so. Nothing here is a secret: these numbers protect nothing, authorise nothing, and have no value to an attacker who predicts them. Using a CSPRNG would suggest the output is security-sensitive, which would be misleading. What matters for test data is that values are well distributed and cheap to produce in bulk, which is what this gives you.

Luhn check digit calculation

The last digit is not random. It is computed so the whole number passes the Luhn checksum (ISO/IEC 7812 Annex B). The algorithm: append a placeholder 0, walk the digits right to left, double every second one, subtract 9 from any doubled result above 9, and sum everything. The check digit is whatever makes that sum a multiple of 10.

Worked through with the partial number 453201234567890:

digits:   4  5  3  2  0  1  2  3  4  5  6  7  8  9  0  [0]
doubled:  ↑     ↑     ↑     ↑     ↑     ↑     ↑     ↑
after:    8  5  6  2  0  1  4  3  8  5  3  7  7  9  0  [0]
                                    (6→12→3, 8→16→7)

sum = 8+5+6+2+0+1+4+3+8+5+3+7+7+9+0+0 = 68
check digit = (10 − (68 mod 10)) mod 10 = 2
result = 4532012345678902

That final number is Luhn-valid. The generator verifies its own output before returning it, and retries if the check fails.

Supporting fields

  • Expiry date — a random month between 01 and 12, and a year one to five years from today. Always in the future, so it will not trip an “expired card” branch you did not mean to test.
  • CVV/CVC — three random digits, or four for American Express. This value is completely random and is not derived from the card number, because it cannot be. A real CVV is computed by the issuer from the PAN, the expiry date, a service code, and a pair of secret DES keys that never leave the issuer. Without those keys, no one outside the bank can produce or verify a genuine CVV. Any site claiming otherwise is not doing what it says.
  • Cardholder name — drawn from a small fixed pool of obviously synthetic names (Alex Tester, Jordan Example, Taylor Sandbox, and similar), so test data reads as test data in a log or a screenshot.

Everything runs in your browser

There is no server-side component. The generator is JavaScript delivered with the page; it makes no network request when you generate, and copy, JSON export, and CSV export are all assembled locally in memory. We never receive a number you generate, so we cannot log or analyse one.

Confirm it in thirty seconds: open developer tools, go to the Network tab, clear it, and generate a card. Nothing appears. Disconnect from the internet after the page loads and the tool still works.

What we deliberately do not do

  • We do not store, distribute, or sell real card data. No dataset of real numbers exists here. Output is computed from randomness and a public checksum, never looked up.
  • We do not run a card checker or BIN validation service. Submitting numbers to find out which ones are active against a real issuer is the defining function of card fraud tooling. We do not offer it and never will.
  • We do not issue virtual cards. We are not a card issuer and hold no funds.
  • We have no accounts, payments, or subscriptions. Nothing to sign up for, nothing to buy.
  • We do not log or analyse generated data. It never reaches us in the first place.

Who this is for

  • Software engineers building payment integrations and checkout flows.
  • QA engineers testing card entry, validation messages, and error paths.
  • Automation engineers seeding fixtures for unit, integration, and end-to-end suites.
  • Designers prototyping payment interfaces with realistic-looking placeholder data.
  • Instructors teaching card number structure, IIN ranges, and checksum algorithms.
  • Security researchers studying payment system behaviour with data that harms no one.

If your work touches a card input field, this is meant for you. The FAQ covers the questions that come up most often.

Who this is not for

If you came here looking for a card that can actually buy something, or get past a paid signup, an age check, or an identity check — this tool is useless to you. Generated numbers are declined by every real payment system, because there is no issuer behind them. And attempting it is fraud regardless of whether it works. Our Disclaimer sets out the boundaries, and the FAQ answers the question directly.

Our editorial standards

Technical claims here are checked against primary sources — ISO/IEC 7812 for number structure, EMVCo and PCI SSC publications for payment mechanics, and providers’ own documentation for anything provider-specific. Where a fact changes over time, such as an IIN range, we say so rather than presenting it as fixed, and we note substantive corrections on the page. Our editorial policy sets out how content is written, reviewed, and updated, and how to tell us we got something wrong. The editorial team page says who “we” are, and — just as important — which subjects we consider outside our competence and refuse to write about.

If you would rather see the business behind the site than the process, How This Site Works covers how it makes money, why nothing you generate leaves your browser, and how to verify both claims yourself.

Contact

CC Generator is built and maintained by a small independent team of developers. We do not publish individual names, but we do answer email.

General: [email protected]

For corrections, privacy requests, abuse reports, or legal questions, the Contact page lists the right address. Or start at the generator if you came here to use the tool.