Credit Card Validator
A card validator checks whether a debit or credit card number is well-formed. It runs the Luhn algorithm, checks length and prefix, and can read the BIN to name the issuing bank and card brand.
Results appear here after you validate a number.
What is a card validator?
A card validator is an online tool that checks whether a debit or credit card number is well-formed. The number is an identification string with a brand prefix, an account portion, and a checksum.
The tool uses the Luhn algorithm (the Mod-10 checksum formula), the length and prefix rules each card network publishes, and often a BIN lookup. Ranking pages sometimes call the same job a debit card checker. This page uses the site-wide name: card validator.
Format validation is the first useful gate in checkout. It is not a fraud decision on its own, and it is not a charge.
How to use a card validator
Using a card validator is three steps: paste the full card number, run validate, and read the Luhn and BIN result. Spaces and hyphens are stripped; you do not need to retype the number as a solid block.
The steps are listed below.
- Click the input field at the top of this page.
- Enter the entire card number (12 to 19 digits, depending on brand).
- Click Validate. The result reports the Luhn algorithm check, an estimated card brand, and whether the length matches that brand.
If the number is not valid, check for a typo first, then confirm length and prefix for that card brand. If you are about to process a payment, contact the issuing bank. The next heading explains the checks behind those result fields.
How a card validator works
A card validator works in a fixed order: it sanitizes the input, checks length, runs the Luhn algorithm, reads the BIN, and names the card brand.
The checksum is Luhn. BIN and IIN lookup names the issuing institution. Prefix and length tell Visa, Mastercard, American Express, and Discover numbers apart.
Luhn Algorithm (Mod-10) Check
The Luhn algorithm is a checksum formula used to validate identification numbers, including debit and credit card numbers. It is also called Mod-10. Hans Peter Luhn published the method at IBM; payment networks still use it as the last-digit check.
A Luhn algorithm check is performed from right to left, as listed below.
- Starting from the right, double every second digit.
- If a doubled value is greater than 9, add its two digits (or subtract 9). Example: 6 × 2 = 12 → 1 + 2 = 3.
- Add every processed digit and every skipped digit.
- If the total is a multiple of 10 (it ends in 0), the number satisfies Luhn.
The last digit of the card number is the check digit. Luhn catches most single-digit errors and many adjacent transpositions. It does not prove the account exists. BIN and IIN digits sit at the other end of the same number.
BIN and IIN (Issuer / Bank Identification Number)
The BIN (Bank Identification Number) is the first six digits of the card number, and sometimes the first eight, and it identifies the issuing bank. IIN (Issuer Identification Number) is the same leading block: those digits name the issuer, not the cardholder account.
BIN / IIN lookup can reveal issuing bank, card brand, country, and card type (credit or debit). You cannot check a specific card with only the BIN. A BIN-only lookup shows issuer-level facts; Luhn still needs the full number.
ISO/IEC 7812 is the numbering standard behind IIN. Issuers have been moving from 6-digit to 8-digit IINs, which is why honest tools say “first six, sometimes eight.” Card brand, prefix, and length are the next filter after that identification number.
Card Brand, Prefix, and Length
Major card networks include Visa, Mastercard, American Express, and Discover. Diners Club, JCB, and UnionPay appear on the same brand tables. Length depends on brand; most card numbers are 13 to 19 digits (16 is typical; American Express uses 15).
Common prefix and length rules are listed below. Ranges are the public IIN values ranking pages already use, not a live scheme file.
| Card brand | Prefix (starts with) | Length |
|---|---|---|
| Visa | 4 | 13, 16, or 19 |
| Mastercard | 51–55, also 2221–2720 | 16 |
| American Express | 34 or 37 | 15 |
| Discover | 6011 (and related Discover IINs) | 16 |
| Diners Club | 300–303, 36, 38 | 14 or 16 |
| JCB | 3528–3589 (and older 18xx / 21xx ranges on some lists) | 16 |
Not every card number has the same prefix and length. The MII (major industry identifier) is the first digit and groups the industry; the rest of the IIN names the card issuer.
Catch bad numbers before the gateway
Format validation is the first useful gate in checkout. It is not a fraud decision on its own, and it is not a charge.
Validate a number