Credit Card Generator

Card numbers that pass the Luhn check, for testing checkout forms. They authorize nothing.

Number
Expiry
CVV

How a card number is validated

Every card number satisfies the Luhn algorithm, defined in ISO/IEC 7812. The arithmetic: from the right, double every second digit; when doubling passes 9, add the two digits of the result (or subtract 9, which is the same). Sum everything. If the total divides by 10, the number passes.

It is a typo check, not a fraud check: it catches a wrong digit and most transpositions of neighbors. Anyone can produce a number that passes Luhn — what decides whether a purchase happens is the issuer's authorization, not this sum.

The prefix names the network

The leading digits are the IIN, which identifies who issued the card. That is why a form recognizes the network while you type, before any lookup. The prefixes published by the networks themselves:

  • Visa — starts with 4; 13, 16 or 19 digits
  • Mastercard — 51 to 55, and the 2-series, 222100 to 272099; 16 digits
  • American Express — 34 or 37; 15 digits
  • Diners Club — 300 to 305, 36 or 38
  • Discover — 6011, 644 to 649, 65; 16 to 19 digits
  • JCB — 3528 to 3589; 16 to 19 digits

The generated number buys nothing

What comes out here passes Luhn and carries the right network prefix. That is all. There is no account behind it, no issuer, no credit line, and no transaction will be authorized. It exists so a form accepts the input and you can keep testing the flow.

And a warning that catches people early: there is no officially reserved BIN range for testing. The test numbers you see in gateway documentation — Stripe's, for instance — work only in that gateway's sandbox, with a test key, and are declined in production. To test real charges, use your payment provider's sandbox, not a generated number.

Frequently asked questions

Can I buy something with the generated card?

No. The number passes the check digit, but there is no bank account behind it: no issuer, no credit line and no transaction gets authorized. Attempting to use it for a purchase is fraud, and it does not work.

So what is it for?

Testing software. Checkout forms validate the number with Luhn and detect the network from the prefix before sending anything. Without a number that passes that validation, you cannot test the input mask, the network detection or the payment error screen.

Are the CVV and expiry real too?

No. They are plausible values in the right shape — three digits, or four on American Express, and a future date. They relate to no issuer and exist to fill the form fields.

Can I test real charges with these?

No. For that, use your payment provider's sandbox numbers, which work only with a test key and simulate approval and decline. There is no officially reserved range for testing outside those environments.

Is the number sent to a server?

No. The draw and the Luhn check digit are computed entirely in your browser. Nothing leaves your device and nothing is stored.

Why does the form know the network before I finish typing?

Because the leading digits identify the issuer: 4 is Visa, 34 and 37 are American Express, 51 to 55 and the 2-series are Mastercard. The form reads that prefix locally, without looking anything up.