Credit Card Number Validator
Check payment-card test numbers locally with Luhn, issuer, length, and batch review, then inspect failing rows, rule traces, and charts.Validation Snapshot
| # | Number | Verdict | Issuer | Checksum | Len | Rule trace | Copy |
|---|---|---|---|---|---|---|---|
| {{ record.index }} | {{ record.formatted }} | {{ record.verdict }} | {{ record.issuer }} | {{ record.luhnValid ? 'Pass' : 'Fail' }} | {{ record.length }} | {{ record.primaryNote }} |
| Section | Rule or field | Status | Detail | Copy |
|---|---|---|---|---|
| Focused record | Number | {{ focusRecord.verdict }} | {{ focusRecord.formatted }} | |
| Focused record | {{ row[0] }} | Metadata | {{ row[1] }} | |
| Rule trace | {{ trace.rule }} | {{ trace.status }} | {{ trace.detail }} |
Introduction
A payment-card number, formally a Primary Account Number or PAN, is a structured identifier. The first digits identify an issuer range, the middle digits identify an account within that range, and the final digit is a checksum used to catch common typing mistakes before a payment system receives the number.
Card-number validation is useful for test data, support-note cleanup, QA fixtures, and copied lists where formatting or one mistyped digit can break a workflow. A structural check can show whether the digits fit the broad card-number range, pass the Luhn checksum, and resemble a known issuer family.
The result should never be read as payment approval. A number can pass a checksum and still be inactive, synthetic, expired, blocked, tokenized, or outside the issuer data available to a local checker. A pass means the visible digits are structurally plausible under the selected rules.
Full PANs are sensitive even during local review. Prefer test numbers, scrubbed samples, or truncated evidence when the goal is to troubleshoot a form, parser, or QA dataset rather than handle real cardholder data.
How to Use This Tool:
Start with one number for a spot check, or switch to batch review before processing a list.
- Paste into Card number or import a TXT or CSV file. Spaces and dashes inside an entry are stripped before validation; entries are separated by new lines, commas, or semicolons.
- Leave Batch mode off when you want only the first parsed number. If extra lines are present, the warning tells you they were ignored. Turn Batch mode on to process the full list.
- Keep Issuer-aware length check on for common card families. It turns checksum-valid but issuer-length-mismatched rows into Review instead of blending them into passing rows.
- Open Advanced for batch cleanup. Remove duplicates collapses repeated numbers when batch mode is on, while Minimum digits drops short digit fragments before checks run.
- Read Validation Snapshot and Validation Log first. The snapshot focuses on the first non-passing record when one exists, and the log shows verdict, issuer, checksum, length, and the main rule note for each row.
- Use Rule Trace for one row at a time. Use Decision Mix, Issuer Mix, and Length Profile to spot batch patterns after the row-level issues are understood.
Interpreting Results:
Pass means the number stays within the broad 12 to 19 digit range, passes the Luhn checksum, and does not trigger an enabled issuer-length concern. It does not mean the card exists, can be charged, or belongs to the detected issuer in a live network.
Review is the caution state. It appears when the checksum passes but the issuer is unknown, or when the detected issuer and length do not match the built-in profile while issuer-aware length review is on. Use Rule Trace to decide whether the row is an expected test credential, a private-label number, a clipped export, or a value that should be corrected.
Fail means the digit count is outside the broad range or the checksum failed. In real lists, that often points to a mistyped digit, a missing digit, a pasted fragment, or two values merged together. Check Validation Log before using the charts, because one failing row can be hidden in a large batch pattern.
The false-confidence trap is a high pass count. If a batch contains full PANs, a clean checksum report still leaves privacy, masking, authorization, and test-data policy questions. Replace full card numbers with approved test data whenever the row detail itself is not required.
Technical Details:
A PAN is made of an issuer identification number, an account identifier, and a check digit. The first digit also carries a Major Industry Identifier (MII) category. Modern issuer identification has moved from older six-digit BIN assumptions toward eight-digit IIN handling, while the total PAN length remains bounded by payment-card numbering rules and issuer practices.
The validation path normalizes each parsed entry to digits, removes short candidates according to Minimum digits, optionally removes duplicates in batch mode, and then applies length, checksum, and issuer rules. The first six and first eight digits are reported as IIN-6 and IIN-8 so older BIN language and newer issuer-identification language can both be reviewed.
Formula Core
The Luhn checksum reads digits from right to left, leaving the check digit undoubled, doubling every second digit, subtracting 9 from doubled values over 9, and accepting the number only when the transformed sum is divisible by 10.
| Symbol or position | Meaning | Transformation |
|---|---|---|
d0 |
Rightmost digit, the check digit. | Use as-is. |
| Even right-to-left index | Positions 0, 2, 4... from the right. |
f(d) = d |
| Odd right-to-left index | Positions 1, 3, 5... from the right. |
Double the digit; subtract 9 when the doubled value is greater than 9. |
S mod 10 = 0 |
The transformed sum ends on a multiple of 10. | Luhn checksum reports Pass. |
For 4111 1111 1111 1111, formatting is stripped to 4111111111111111. From the right, eight positions remain unchanged, seven 1 digits are doubled to 2, and the leftmost 4 is doubled to 8. The sum is 30, so 30 mod 10 = 0 and the checksum passes.
Issuer and Verdict Rules
Issuer detection is based on the built-in prefix profiles shown below. These profiles are useful for common card families and test data, but they are not a live issuer-routing database.
| Issuer label | Prefix rule | Expected lengths |
|---|---|---|
| Visa | Starts with 4 |
13, 16, 19 |
| Mastercard | 51 to 55, or 2221 to 2720 |
16 |
| American Express | 34 or 37 |
15 |
| Diner's Club | 300 to 305, 36, 38, or 39 |
14 |
| Discover | 6011, 65, 644 to 649, or 622126 to 622925 |
16, 19 |
| JCB | 3528 to 3589 |
16, 17, 18, 19 |
| UnionPay | Starts with 62 |
16, 17, 18, 19 |
| Maestro | Starts with 50, 56, 57, 58, 63, or 67 |
12 to 19 |
| Verdict | Rule | Boundary |
|---|---|---|
| Pass | Broad digit range passes, Luhn passes, and issuer rules raise no enabled concern. | Structural plausibility only. |
| Review | Luhn passes, but issuer is unknown or detected issuer length is unusual when issuer-aware review is on. | Manual context required before trust. |
| Fail | Digit count is below 12 or above 19, or Luhn fails. | Treat as a bad entry until corrected. |
Privacy Notes:
The checks run in the browser session after the page loads, and imported text files are read locally. That does not make real PAN handling casual. Full card numbers can still leak through visible input, copied rows, exports, screenshots, browser history, or pasted notes.
PCI guidance limits displayed PAN to the BIN and last four digits unless there is documented business justification for seeing more. Use this page for approved test data or controlled internal review, not for storing or circulating live cardholder data.
Worked Examples:
One familiar test number
Entering 4111 1111 1111 1111 with Batch mode off produces one row in Validation Log. The row shows Pass, Visa, Checksum as Pass, and length 16. That means the number is structurally plausible as test data, not that it can be charged.
Broken checksum in a QA list
A list containing 4111111111111111 and 4111111111111112 should be run with Batch mode on. The second row lands in Fail, Validation Snapshot focuses that failing record, and Rule Trace shows Luhn checksum as Fail. Correct the digit before using the list in tests.
Checksum passes but issuer needs context
If a number passes Luhn but no built-in prefix profile matches, Validation Log marks it Review with issuer Unknown. That row may be a private-label or synthetic test value, but it should not be treated as a normal card-family match without the original source or issuer context.
Short fragments from copied notes
A pasted support note may include a four-digit ending and a full test number on the next line. With Minimum digits at 12, the four-digit fragment is dropped before validation and the summary badge reports the dropped short entry. Lower the minimum only when you are deliberately debugging digit extraction.
FAQ:
Does Pass mean the card is real?
No. Pass means the digits look structurally consistent under local checks. Account status, authorization, expiration, fraud screening, and live issuer decisions are outside the result.
Why were extra lines ignored?
When Batch mode is off, only the first parsed number is checked. Turn Batch mode on before reviewing newline, comma, or semicolon-separated lists.
What creates a Review result?
Review appears when the checksum passes but the issuer prefix is unknown, or when issuer-aware length review is enabled and the length does not fit the detected issuer profile.
Why show IIN-6 and IIN-8?
Both appear in payment operations. Six-digit BIN language remains common, while eight-digit issuer identification reflects the newer numbering transition. The fields let reviewers compare both slices without changing the source number.
What data should I paste?
Use approved test numbers or scrubbed samples whenever possible. Even with local processing, full PANs should be handled only when there is a clear business reason and proper controls.
Glossary:
- PAN
- Primary Account Number, the full payment-card number being checked.
- IIN
- Issuer Identification Number, the leading digits that identify an issuer range.
- BIN
- Bank Identification Number, an older payment-industry term often used for the issuer prefix.
- MII
- Major Industry Identifier, the first digit of the PAN and a broad category hint.
- Luhn checksum
- The mod-10 check that helps catch mistyped card-number digits.
- Issuer-aware length check
- The optional comparison between detected card family and expected digit counts.
References:
- Issuer Identifier Number - IINs, ANSI.
- 8-digit BIN Industry Change, Visa.
- PCI DSS masking and truncation for 8-digit BINs, PCI Security Standards Council.
- Computer for verifying numbers, Google Patents, 1960.