Card Type Detector
Detect the brand from the first digits and length of a card number.
Prefix rules used
- Visa: starts with 4, 13 or 16 digits
- Mastercard: starts with 51-55 or 2221-2720, 16 digits
- AMEX: starts with 34 or 37, 15 digits
- Discover: starts with 6011, 65, or 644-649, 16 digits
Related tools
Card brand prefixes diagram
How this tool works
The type field records what kind of product a card is: credit, debit, prepaid or commercial. The distinction is what happens at the moment of authorisation, and it changes the answer to the question a decline is asking. An empty prepaid balance and a credit limit are both refusals, but they mean completely different things and are handled differently by a merchant and by a cardholder.
The type is a property of the issuer's product rather than of the number, and the data records it for every prefix. Cards sharing a prefix normally share a type, though an issuer can issue several product types across one allocation, which is why the breakdown is reported per prefix rather than only per issuer.
What each type means
| Type | Funds come from | What a decline means |
|---|---|---|
| CREDIT | A revolving line of credit | A credit decision by the issuer |
| DEBIT | A bank account | Insufficient funds or a block |
| PREPAID | A balance loaded in advance | Usually an empty balance |
| COMMERCIAL | A company account | The organisation's credit terms |
Category is a separate field and is more specific: it distinguishes standard, commercial, government and purchasing products within the commercial and credit types.
When to use it
- Decide how to interpret a decline on a given card
- Set a different retry policy for prepaid and credit cards
- Filter a set of records by product type
- Confirm that a listing describes the product type it claims
Frequently asked questions
What is a card type?
The product category a card belongs to: credit, debit, prepaid or commercial. It determines where the money comes from at authorisation and therefore what a decline means.
How is a card type different from a card category?
Type is the broad product family. Category is more specific and sits within it, distinguishing standard, commercial, government and purchasing products.
Does the type come from the card number?
It comes from the prefix, because the issuer allocates ranges by product. Cards sharing a prefix normally share a type, though an issuer can run several products across one allocation.
Why does the type matter when a payment fails?
Because a decline on a prepaid card is usually an empty balance and a decline on a credit card is a credit decision. Retrying the second with a different card makes sense; retrying the first does not.
Can a single prefix carry more than one type?
Yes. An issuer that receives an allocation for several products can issue them across it, which is why the breakdown is reported per prefix.