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