How it works
Every number opens with a prefix drawn from the brand’s real issuer identification ranges: a 4 for Visa, 51–55 or 2221–2720 for Mastercard, 34 or 37 for American Express, 6011, 644–649 or 65 for Discover, 3528–3589 for JCB, and 300–305, 36 or 38–39 for Diners Club. One range is picked at random and then a value inside it, so a batch of Mastercard numbers mixes the older 5-series with the newer 2-series the way a real customer file does. Random digits then fill the number to one short of the brand’s length.
The final digit is not random. It is the Luhn check digit, chosen so the whole number passes the checksum every payment form runs before it contacts a gateway: working from the right, every second digit is doubled, nine is subtracted from any result above nine, the digits are added up, and the check digit is whatever brings the total to a multiple of ten. That is exactly why a generated number is accepted by a client-side validator and refused by an issuer — the shape is right and the account behind it does not exist.
A custom BIN or prefix replaces the brand’s own while keeping the brand’s length and check digit, so one issuer range can be exercised on its own. It must be digits only and leave at least two positions free, one random digit and the checksum, or every number would come out identical; the field says so instead of generating. Expiry dates fall one to thirty-six months ahead of today, the CVV is three random digits (four for American Express) and the holder is a name from a short list for the chosen country, which changes nothing about the number itself.