Test number
Do not paste live customer cards. This field is not written to localStorage.
Checksum resultLuhn pass
••••••••••••1111
Luhn: pass
Brand guess: Visa
Length: 16
Default 4111111111111111 passes Luhn and is classified as Visa. This cannot charge a card or prove an account is real.
Free Luhn Checker for Test Card Numbers - Brand Guess, No Storage
Default 4111111111111111 is a Visa test PAN with a valid Luhn checksum. Numbers are never written to localStorage. This is not a payment gateway and not a card generator.
What a Credit Card Validator Can Honestly Claim
A credit card validator on this site is a Luhn checksum checker plus a coarse IIN/BIN brand guess. Payment-card numbers include a check digit defined by ISO/IEC 7812, commonly called the Luhn algorithm. Double every second digit from the right, subtract 9 when the product exceeds 9, and require the sum to be divisible by 10. The default 4111111111111111 is a widely published Visa test PAN. It passes Luhn. Prefix 4 and length 16 classify it as Visa. That is the worked check.
The number is not stored, not logged, and not sent to a processor. This site cannot take payment. Brand detection uses IIN prefixes: Visa 4; Mastercard 51–55 and 2221–2720; American Express 34/37; Discover 6011/65/644–649. Co-branded and regional ranges can be wrong. Length is checked against common brand lengths. None of that proves the account exists, has funds, or is authorized.
This page will not generate card numbers, enumerate BINs, or help anyone test stolen cards. If that is the job you had in mind, stop. Use only published test PANs from your payment provider's documentation.
How to Check a Test PAN - Step by Step
Format checking a published test number takes under a minute:
- Keep or paste a published test PAN - The default is the well-known Visa test number 4111111111111111. Use only test numbers from your payment provider documentation.
- Read Luhn and brand - That number passes Luhn and is classified as Visa by prefix 4 and length 16. Length outside 12–19 digits is rejected as a format check.
- Copy the masked report - Copy if you need a note. The result shows a masked PAN. The full number is never written to localStorage.
- Do not charge or generate - This page cannot take payment and will not generate card numbers. A passing checksum is not proof an account exists.
Luhn Example - Default Visa Test PAN
The default field is the published Visa test number used across payment-provider docs. Spaces are stripped; only digits are checked.
Input - published test PAN
4111111111111111
Output - masked checksum report
Masked: ••••••••••••1111 Length: 16 Luhn checksum: pass Brand guess: Visa Format check only. Not a payment, not stored, not proof the account exists.
From the right: digits 1,1,1,1,1,1,1,1. Alternating double starts on the second-from-right digit. After the Luhn fold, the sum is divisible by 10, so the check digit is consistent. Prefix 4 with length 16 is the Visa guess. Changing the last digit to 0 typically fails Luhn - that is a typo catch, not a bank decline.
When a Luhn Checker Helps - and When It Must Not
Checkout form QA with documented test PANs
Payment providers publish test numbers so you can exercise client-side formatting without hitting a live processor. This page confirms the checksum and a brand guess before you wire Stripe, Braintree, or a gateway sandbox. It is not the sandbox.
Catching transposition typos
Luhn was designed to catch single-digit errors and many adjacent transpositions. If a tester mistypes a documented PAN, a fail here saves a confusing gateway error later. It still cannot tell a made-up Luhn-valid string from a real account.
Teaching ISO/IEC 7812 check digits
Students who need to see the algorithm on a known Visa test number can use the default field. The report is masked on purpose so a screenshot does not look like a live PAN dump.
Not card-not-present fraud testing
Do not paste live customer cards. Do not use this tool to probe stolen numbers. A pass is not authorization. This origin is not PCI scope for your merchant account; treating it as a vault is a mistake.
Not a BIN database
Brand is a prefix heuristic, not an issuing-bank lookup. Co-branded cards and regional schemes can show Unknown or the wrong brand. Length filters common Visa/Mastercard/Amex/Discover shapes; they do not enumerate ranges. UnionPay, JCB, Maestro, and other schemes are not in the small table on purpose: this page is a Luhn classroom, not a card-scheme encyclopedia. If you are writing a React checkout, validate length and Luhn in the client for UX, then let the processor decide. Fullscreen is for the checksum panel only. Copy and Clear sit on the unique credit-card-validator-split-track workbench.
Related token tools are still not payments
Decoding a JWT belongs on the JWT decoder. Hashing a string belongs on the hash generator. Neither charges a card.
Luhn vs Gateway vs Generator
Search results mix three products. Only the first column is this page:
| Capability | This Luhn checker | Payment gateway | PAN generator |
|---|---|---|---|
| Checksum on digits you typed | ✓ | ||
| Default 4111111111111111 Visa test | ✓ | ||
| Charge / authorize / capture | ✓ | ||
| Prove the account exists | maybe | ||
| Mint new Luhn-valid numbers | never | refused here | |
| Store the PAN | never | PCI vault |
The general rule: checksum for typos, gateway for money, never generate PANs on this origin.
How Brand Guessing Works - Prefixes and Length
After digits are isolated, the page runs a Luhn checksum and a small brand-prefix table. Visa expects a leading 4 and length 13, 16, or 19. Mastercard expects 16 digits in 51–55 or 2221–2720. American Express expects 15 digits starting 34 or 37. Discover expects 16 digits in 6011, 65, or 644–649. Anything else is Unknown. That list is intentionally small. It is not a complete BIN table and will not be expanded into a generator.
Length outside 12–19 is rejected before Luhn. Spaces and punctuation are stripped so a typed 4111 1111 1111 1111 still matches the default digits. Copy always writes the masked report, never the raw field, so a clipboard dump is less likely to look like a live PAN.
Walking Luhn on 4111111111111111 Without Inventing Numbers
Start at the rightmost digit (the check digit) and move left. Do not double the check digit; double every other digit after that. For the published Visa test PAN the digits are sixteen ones after the leading 4. After doubling, any value above 9 is reduced by 9 (equivalently, add the two digits of the product). Sum everything. If the total modulo 10 is 0, Luhn passes. That is the entire algorithm this page runs. It is public, old, and intentionally weak: it was built for transcription errors, not for cryptography and not for proving an issuer will honor a charge.
A failing last digit is the usual classroom demo: keep the documented prefix and length, change only the check digit, and watch the report switch from pass to fail. That still does not mint a new card. It shows why a checkout form can reject a typo before a network call. Test suites at Stripe, Braintree, Adyen, and similar processors publish their own PANs for decline codes, 3-D Secure, and brand mix. Copy those from the vendor doc. Do not ask this page to invent a passing number for a BIN you typed. The code path from input to luhnValid is one-way.
IIN (issuer identification number), still often called BIN, is the leading six or eight digits that used to map to an issuer. This tool does not query a BIN list. It only pattern-matches a handful of brand prefixes plus length. Visa's leading 4 is the reason the default is classified Visa. Mastercard's 2221–2720 range exists because ISO expanded the brand beyond 51–55. American Express 34/37 with 15 digits is the other common classroom case. Discover's 6011/65/644–649 set is incomplete compared with a commercial BIN database. Unknown means "not in this small table," not "invalid card."
CVV, expiry, name, AVS, 3-D Secure, and network tokens are out of scope. Entering them here would be a mistake even for test data. The input is a single numeric field. The output is masked digits, a boolean checksum, a brand string, and a length. If your job needs an authorization, you need a gateway and a sandbox key you control - not a static HTML page.
PCI DSS is a program for people who store, process, or transmit cardholder data. This origin is a static developer utility. It does not tokenize, vault, or charge. Treating a Luhn pass as "the card is good" is how toy checkouts leak. Your integration tests should use the processor's published PANs and their test keys, then assert on the processor's response codes. This page only answers: are these digits the right length, does Luhn hold, and which of four brand prefixes matches. That is useful the day you write a onBlur formatter. It is useless the day you try to cash out.
Masking shows bullets plus the last four so a screenshot can be discussed in a ticket without dumping the full test PAN. Copy writes that masked report, not the input. Clear restores 4111111111111111 instead of emptying the field so the worked check stays one click away. Width of the split is the only localStorage write, under credit-card-validator-panel-width. If you paste a number and refresh, the field returns to the Visa test default - by design, not a bug.
Privacy - Why the PAN Never Hits localStorage
Other tools on this site remember drafts for 30 days in localStorage. Card numbers are excluded. The PAN is never written to disk. Clearing the field drops the digits from memory. Do not paste live customer cards into a browser origin you do not control - including this one. PCI-ish hygiene still applies to test tools.
Panel width may be stored under credit-card-validator-panel-width. That is a layout preference, not a card number. The split track class credit-card-validator-split-track is unique so resize does not collide with other workbenches.
Frequently Asked Questions
What does this credit card validator check?
Two format facts: the Luhn checksum and a brand guess from the IIN/BIN prefix plus length. It cannot tell whether an account exists, has funds, or is stolen. It is not a payment gateway.
Why is 4111111111111111 the default?
It is a widely published Visa test PAN used in documentation. It has a valid Luhn checksum. Prefix 4 and length 16 classify it as Visa. It is not a chargeable card on this site because nothing is charged.
Do you store the number?
No. The digits are not written to localStorage, cookies, or a server. The field is masked in the result. Do not paste live customer cards.
Can I generate valid card numbers here?
No. This page only checks a number you already have. It will not enumerate PANs or help anyone invent numbers that pass Luhn.
What brands are detected?
Visa, Mastercard, American Express, Discover, and a generic fallback. Co-branded and regional prefixes can be wrong. Length is checked against common brand lengths.
Is a passing Luhn check proof the card is real?
No. Luhn catches typos. Criminals and test suites both produce Luhn-valid numbers. Never use this tool to test stolen cards.
Why is localStorage off for this field?
Other tools on this site remember drafts for 30 days. Card numbers are excluded on purpose. Clearing the field drops the digits from React state. Panel width may still be remembered; the PAN is not.
What length ranges are accepted?
Digits are stripped of spaces and punctuation. Lengths outside 12–19 are rejected as a format check. Payment-network PANs are typically in that range.
Related Developer Tools (Not Payment Tools)
These utilities sit next to format checks. None of them take payment:
- JWT decoder - Inspect token claims. Not a card processor.
- Hash generator - Digest strings. Not a PAN vault.
- JSON validator - Check API payloads that must never include live PANs.
- API tester - Call APIs you are authorized to use. Do not send live cards through it.
Related Tools
Discover more free developer tools that might interest you.
JSON Validator
Validate RFC 8259 JSON and report line and column errors
Use ToolJSON5 Validator
Validate JSON5 (comments, trailing commas, unquoted keys)
Use ToolCSS Validator
Parse CSS and report syntax errors with locations
Use ToolJavaScript Validator
Parse JavaScript syntax with Acorn. Does not run the code
Use ToolXML Validator
Check that XML is well-formed. Not a full XSD or DTD validator
Use ToolYAML Validator
Parse YAML documents and report syntax errors
Use ToolRelated guides
Read the how-to, then come back to this tool when you are ready to run it locally.