Credit Card Type Identifier

Identify the payment brand from a card number's IIN and run the Luhn check.

Open tool

Overview

A credit card type identifier inspects a card number and reports which payment network issued it, along with a pass or fail on the Luhn checksum. Networks reserve specific Issuer Identification Number (IIN) ranges — also called BIN ranges — and the length of the account number is itself a fingerprint. Visa always starts with 4 and is 13, 16, or 19 digits. Mastercard starts with 5155 or 22212720 and is 16 digits. American Express starts with 34 or 37 and is 15 digits. Discover, JCB, UnionPay, Diners Club, and Maestro each have their own ranges and lengths.

Identification is useful at checkout for branding the card field icon, routing to the right acquirer fee schedule, or rejecting card types a merchant does not accept. The Luhn check catches typos before the network is even contacted — it costs nothing on the client and prevents a meaningful share of friendly declines. Neither IIN matching nor Luhn validates that the card is real, active, or has available balance; only a network authorization can do that.

How it works

IIN matching is a straightforward prefix-and-length lookup against the published ranges for each scheme. The Luhn algorithm verifies a check digit: starting from the rightmost digit, double every second digit; if doubling produces a two-digit result, sum its digits. Add all the resulting digits together — a valid card number's total is a multiple of 10. The check digit itself is the last digit of the account number, chosen so the sum is zero modulo 10.

Examples

  • 4111 1111 1111 1111 — starts with 4, sixteen digits, Luhn sum 70. Visa, valid format.
  • 5500 0000 0000 0004 — IIN 55 and sixteen digits. Mastercard, valid Luhn.
  • 3400 0000 0000 009 — IIN 34, fifteen digits. American Express, valid Luhn.
  • 6011 0000 0000 0004 — IIN 6011, Discover, sixteen digits, valid checksum.
  • 4111 1111 1111 1112 — Visa range but the last digit breaks Luhn — flagged as invalid.

FAQ

Does the IIN tell me which bank issued the card?
The first six digits are the bank identifier in principle, but full BIN-to-issuer databases are commercial. The tool only resolves the payment network.

Why do some Mastercards now start with 2?
In 2017 Mastercard expanded into the 22212720 range to relieve pressure on the 5 block.

Is a Luhn-valid number a real card?
No. Luhn is a check digit, not an authorization. It only screens out obvious typos.

Should I store the full card number to identify it?
PCI DSS strongly discourages storing PANs. Match the IIN client-side then drop the digits, or use the tokenized BIN that your processor returns.

Are virtual cards detected?
Often yes — they live within a normal issuer BIN — but some BNPL and virtual-only programs use ranges the lookup table may not include.

Try Credit Card Type Identifier

An unhandled error has occurred. Reload ×