Card Type Detector

Detect the brand from the first digits and length of a card number.

Prefix rules used

Related tools

Card brand prefixes diagram

Table of Visa, Mastercard, AMEX and Discover prefix ranges and card number lengths

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

TypeFunds come fromWhat a decline means
CREDITA revolving line of creditA credit decision by the issuer
DEBITA bank accountInsufficient funds or a block
PREPAIDA balance loaded in advanceUsually an empty balance
COMMERCIALA company accountThe 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

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.