The process of assigning payment card numbers is not random. In fact, there is a complex system of rules in place for assigning new cards called the ISO/IEC 7812. Each payment card brand around the world is required to operate according to ISO standards.
Card numbers can have between 12 and 19 digits for specialized industry-specific cards, but the most common length is 16. The first digit of the card number is what’s called the major industry identifier, or MII. This number divides payment cards into a few specified groups based on the card issuer’s industry, such as airlines, travel, gas, or banking and finance.
Each card brand is assigned a set of possible card numbers within a preset range. The five most used card brands in the US begin with the following numbers:
• Visa: 4
• American Express: 34 or 37
• Diner’s Club: 36
• MasterCard: 51, 55, or 2221-2720
• Discover: 6011, 622126-622925, 644-649, 65
The first six digits of the card number are collectively known as the issuer identification number (IIN), also referred to as a bank identification number (BIN). This identifies the specific institution that issued the card. Each bank in the world has a unique IIN, and every card issued by that bank will begin with the same six-digit number.
There are more details, but that covers all the basics of how payment card numbers are assigned. I hope this clears it up for you!