---
description: Free card number validator. Check any card number against the Luhn algorithm, detect the card network, and verify length. Runs entirely in your browser.
title: Card Number Validator | Luhn Check &amp; Card Network Detection | SmartRetry
image: https://cdn.smartretry.com/_next/static/media/og-image.0z0q4_5kazzzo.jpeg
---

[Skip to main content](#main-content)

# Card Number Validator

Check any card number against the Luhn algorithm and detect its network, entirely in your browser.

Enter a card number to see validation results.

Try a test card number

* ![Visa](https://cdn.smartretry.com/cdn-cgi/image/width=3840&quality=75&format=auto&fit=cover/https%3A%2F%2Fcdn.smartretry.com%2F_next%2Fstatic%2Fmedia%2Fvisa.3icxosu84htie.svg)4242 4242 4242 4242Visa
* ![Visa](https://cdn.smartretry.com/cdn-cgi/image/width=3840&quality=75&format=auto&fit=cover/https%3A%2F%2Fcdn.smartretry.com%2F_next%2Fstatic%2Fmedia%2Fvisa.3icxosu84htie.svg)4000 0566 5566 5556Visa (debit)
* ![Mastercard](https://cdn.smartretry.com/cdn-cgi/image/width=3840&quality=75&format=auto&fit=cover/https%3A%2F%2Fcdn.smartretry.com%2F_next%2Fstatic%2Fmedia%2Fmastercard.3p3180nd6w8u0.svg)5555 5555 5555 4444Mastercard
* ![American Express](https://cdn.smartretry.com/cdn-cgi/image/width=3840&quality=75&format=auto&fit=cover/https%3A%2F%2Fcdn.smartretry.com%2F_next%2Fstatic%2Fmedia%2Famex.2s5ay-cndp-qr.svg)3782 822463 10005Amex
* ![Discover](https://cdn.smartretry.com/cdn-cgi/image/width=3840&quality=75&format=auto&fit=cover/https%3A%2F%2Fcdn.smartretry.com%2F_next%2Fstatic%2Fmedia%2Fdiscover.3z00s1jrsvl1i.svg)6011 1111 1111 1117Discover
* ![JCB](https://cdn.smartretry.com/cdn-cgi/image/width=3840&quality=75&format=auto&fit=cover/https%3A%2F%2Fcdn.smartretry.com%2F_next%2Fstatic%2Fmedia%2Fjcb.3ga4ffiyrbhso.svg)3566 0020 2036 0505JCB
* ![Diners](https://cdn.smartretry.com/cdn-cgi/image/width=3840&quality=75&format=auto&fit=cover/https%3A%2F%2Fcdn.smartretry.com%2F_next%2Fstatic%2Fmedia%2Fdiners.2109hog9s0yom.svg)3056 9309 0259 04Diners Club
* ![UnionPay](https://cdn.smartretry.com/cdn-cgi/image/width=3840&quality=75&format=auto&fit=cover/https%3A%2F%2Fcdn.smartretry.com%2F_next%2Fstatic%2Fmedia%2Funionpay.3u8onnihn5f5h.svg)6200 0000 0000 0005UnionPay
* ![Maestro](https://cdn.smartretry.com/cdn-cgi/image/width=3840&quality=75&format=auto&fit=cover/https%3A%2F%2Fcdn.smartretry.com%2F_next%2Fstatic%2Fmedia%2Fmaestro.0xcevro9_uxwm.svg)6759 6498 2643 8453Maestro

## Card Network Detection Rules

| Network     | Prefix(es)                              | Length     |
| ----------- | --------------------------------------- | ---------- |
| Visa        | 4                                       | 13, 16, 19 |
| Mastercard  | 51-55, 2221-2720                        | 16         |
| Amex        | 34, 37                                  | 15         |
| Diners Club | 36, 38, 300-305                         | 14-19      |
| JCB         | 3528-3589                               | 16-19      |
| Maestro     | 5018, 5020, 5038, 6304, 6759, 6761-6763 | 12-19      |
| Discover    | 6011, 622126-622925, 644-649, 65        | 16-19      |
| UnionPay    | 62                                      | 16-19      |

Learn More

## How card number validation works

Every card number carries its own integrity check. Validating the structure before a transaction is sent catches typos and formatting mistakes that would otherwise come back as an avoidable decline.

### What is card number validation?

Card number validation checks that a Primary Account Number (PAN) is structurally correct: the network prefix is recognized, the length matches that network, and the Luhn checksum resolves. It confirms the number is well-formed, not that the account exists or has funds.

A card number is not a random string. The leading digits identify the issuing network, the length is fixed per network, and the final digit is a checksum calculated from every digit before it.

Because all three properties can be checked locally, a mistyped number can be caught in the checkout form itself, before it ever reaches an acquirer. That saves a round trip, avoids a decline on the customer record, and keeps authorization rates cleaner.

Structural validation is not an authorization. A number that passes every check here can still be declined for insufficient funds, a block, or an expired card, since those depend on the issuer.

### How this validator checks a number

1. 1  
#### Detect the card network  
The leading digits are matched against published network ranges, for example 4 for Visa, 51-55 and 2221-2720 for Mastercard, 34 and 37 for Amex.
2. 2  
#### Verify the length  
Each network issues numbers of specific lengths. Amex is 15 digits, Mastercard is 16, and Visa can be 13, 16, or 19.
3. 3  
#### Run the Luhn checksum  
Every second digit from the right is doubled, values above nine have nine subtracted, and the total must divide evenly by ten.
4. 4  
#### Report the result  
A number is reported valid only when the network is recognized, the length matches that network, and the checksum resolves.

### Common validation failures

| Symptom                   | Usual cause                                                                                          |
| ------------------------- | ---------------------------------------------------------------------------------------------------- |
| Luhn check fails          | A single mistyped digit, or two adjacent digits transposed.                                          |
| Length not valid          | Digits missing or duplicated, often from a copy and paste that dropped a character.                  |
| Unrecognized network      | A test number, a non-card number, or a regional scheme outside the ranges listed above.              |
| Valid here, declined live | Structure is fine; the decline is an issuer decision such as funds, fraud rules, or an expired card. |

### FAQs

What is the Luhn algorithm?

The Luhn algorithm, also called mod 10, is a checksum formula used to validate identification numbers such as card numbers. It reliably detects any single-digit error and most transpositions of adjacent digits.

Does this tool send my card number anywhere?

No. All validation runs in your browser. The number is never transmitted to a server, stored, or logged.

Does a valid number mean the card works?

No. Validation only confirms the number is structurally correct. Whether a payment succeeds depends on the issuer, the available balance, and the card status.

Why does a real card show as an unrecognized network?

The detection ranges cover the major global networks. Regional or domestic schemes outside those ranges will not match, even though the card is legitimate.

How does validating numbers reduce declines?

Catching a malformed number in the form prevents an authorization attempt that would fail anyway. Fewer avoidable attempts means cleaner authorization rates and less friction for the customer.

Other tools to help you

* [BIN Lookup](/bin)
* [MCC Lookup](/mcc)
* [Decline Code Lookup](/decline-code)
* [Issuer Lookup](/issuer)

![SmartRetry - Payment Recovery Platform](https://cdn.smartretry.com/cdn-cgi/image/width=3840&quality=75&format=auto&fit=cover/https%3A%2F%2Fcdn.smartretry.com%2F_next%2Fstatic%2Fmedia%2Flogo.3mm2n0hdxl3mi.svg)

## Turn avoidable declines into approvals

Catching malformed numbers is one small piece. SmartRetry recovers the failed payments that still slip through, automatically and without changing your payment provider.

Email address Let’s talk

---

```json
{"@context":"https://schema.org","@type":"WebPage","name":"Card Number Validator | Luhn Check & Card Network Detection | SmartRetry","description":"Free card number validator. Check any card number against the Luhn algorithm, detect the card network, and verify length. Runs entirely in your browser.","url":"https://www.smartretry.com/card-validator","author":{"@type":"Organization","@id":"https://www.smartretry.com/#organization","name":"SmartRetry","url":"https://www.smartretry.com","logo":{"@type":"ImageObject","url":"https://cdn.smartretry.com/logo.png","width":{"@type":"QuantitativeValue","value":175,"unitCode":"PX"},"height":{"@type":"QuantitativeValue","value":29,"unitCode":"PX"}},"description":"SmartRetry is a smart payment recovery platform that helps businesses save revenue from failed payment transactions and reduce false declines.","sameAs":["https://x.com/smartretry","https://www.facebook.com/smartretry","https://www.instagram.com/smartretry","https://www.linkedin.com/company/smartretry","https://www.youtube.com/@smartretry"],"contactPoint":{"@type":"ContactPoint","contactType":"customer support","availableLanguage":["Hebrew","English"],"url":"https://www.smartretry.com/contact"},"address":{"@type":"PostalAddress","streetAddress":"Menachem Begin","addressLocality":"Tel Aviv-Yafo","addressCountry":"IL"}},"isPartOf":{"@type":"WebSite","@id":"https://www.smartretry.com/#website","name":"SmartRetry","url":"https://www.smartretry.com","description":"Payment recovery guides, tools and reference data from SmartRetry - failed payment recovery, false decline prevention and authorization rate optimization.","inLanguage":"en","publisher":{"@type":"Organization","@id":"https://www.smartretry.com/#organization","name":"SmartRetry","url":"https://www.smartretry.com","logo":{"@type":"ImageObject","url":"https://cdn.smartretry.com/logo.png","width":{"@type":"QuantitativeValue","value":175,"unitCode":"PX"},"height":{"@type":"QuantitativeValue","value":29,"unitCode":"PX"}},"description":"SmartRetry is a smart payment recovery platform that helps businesses save revenue from failed payment transactions and reduce false declines.","sameAs":["https://x.com/smartretry","https://www.facebook.com/smartretry","https://www.instagram.com/smartretry","https://www.linkedin.com/company/smartretry","https://www.youtube.com/@smartretry"],"contactPoint":{"@type":"ContactPoint","contactType":"customer support","availableLanguage":["Hebrew","English"],"url":"https://www.smartretry.com/contact"},"address":{"@type":"PostalAddress","streetAddress":"Menachem Begin","addressLocality":"Tel Aviv-Yafo","addressCountry":"IL"}}},"mainEntity":{"@type":"WebApplication","@id":"https://www.smartretry.com/card-validator#webapplication","name":"Card Number Validator | Luhn Check & Card Network Detection | SmartRetry","description":"Free card number validator. Check any card number against the Luhn algorithm, detect the card network, and verify length. Runs entirely in your browser.","applicationCategory":"BusinessApplication","operatingSystem":"Web","browserRequirements":"Requires a modern web browser with JavaScript enabled.","url":"https://www.smartretry.com/card-validator","featureList":["Luhn algorithm check","Card network detection","Card number length validation","Client-side only, no data transmitted"],"provider":{"@type":"Organization","@id":"https://www.smartretry.com/#organization","name":"SmartRetry","url":"https://www.smartretry.com","logo":{"@type":"ImageObject","url":"https://cdn.smartretry.com/logo.png","width":{"@type":"QuantitativeValue","value":175,"unitCode":"PX"},"height":{"@type":"QuantitativeValue","value":29,"unitCode":"PX"}},"description":"SmartRetry is a smart payment recovery platform that helps businesses save revenue from failed payment transactions and reduce false declines.","sameAs":["https://x.com/smartretry","https://www.facebook.com/smartretry","https://www.instagram.com/smartretry","https://www.linkedin.com/company/smartretry","https://www.youtube.com/@smartretry"],"contactPoint":{"@type":"ContactPoint","contactType":"customer support","availableLanguage":["Hebrew","English"],"url":"https://www.smartretry.com/contact"},"address":{"@type":"PostalAddress","streetAddress":"Menachem Begin","addressLocality":"Tel Aviv-Yafo","addressCountry":"IL"}},"isAccessibleForFree":true,"offers":{"@type":"Offer","price":"0","priceCurrency":"USD","availability":"https://schema.org/InStock"}}}
{"@context":"https://schema.org","@type":"FAQPage","author":{"@type":"Organization","@id":"https://www.smartretry.com/#organization","name":"SmartRetry","url":"https://www.smartretry.com","logo":{"@type":"ImageObject","url":"https://cdn.smartretry.com/logo.png","width":{"@type":"QuantitativeValue","value":175,"unitCode":"PX"},"height":{"@type":"QuantitativeValue","value":29,"unitCode":"PX"}},"description":"SmartRetry is a smart payment recovery platform that helps businesses save revenue from failed payment transactions and reduce false declines.","sameAs":["https://x.com/smartretry","https://www.facebook.com/smartretry","https://www.instagram.com/smartretry","https://www.linkedin.com/company/smartretry","https://www.youtube.com/@smartretry"],"contactPoint":{"@type":"ContactPoint","contactType":"customer support","availableLanguage":["Hebrew","English"],"url":"https://www.smartretry.com/contact"},"address":{"@type":"PostalAddress","streetAddress":"Menachem Begin","addressLocality":"Tel Aviv-Yafo","addressCountry":"IL"}},"mainEntity":[{"@type":"Question","name":"What is the Luhn algorithm?","acceptedAnswer":{"@type":"Answer","text":"The Luhn algorithm, also called mod 10, is a checksum formula used to validate identification numbers such as card numbers. It reliably detects any single-digit error and most transpositions of adjacent digits."}},{"@type":"Question","name":"Does this tool send my card number anywhere?","acceptedAnswer":{"@type":"Answer","text":"No. All validation runs in your browser. The number is never transmitted to a server, stored, or logged."}},{"@type":"Question","name":"Does a valid number mean the card works?","acceptedAnswer":{"@type":"Answer","text":"No. Validation only confirms the number is structurally correct. Whether a payment succeeds depends on the issuer, the available balance, and the card status."}},{"@type":"Question","name":"Why does a real card show as an unrecognized network?","acceptedAnswer":{"@type":"Answer","text":"The detection ranges cover the major global networks. Regional or domestic schemes outside those ranges will not match, even though the card is legitimate."}},{"@type":"Question","name":"How does validating numbers reduce declines?","acceptedAnswer":{"@type":"Answer","text":"Catching a malformed number in the form prevents an authorization attempt that would fail anyway. Fewer avoidable attempts means cleaner authorization rates and less friction for the customer."}}]}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://www.smartretry.com/"},{"@type":"ListItem","position":2,"name":"Card Number Validator | Luhn Check & Card Network Detection | SmartRetry","item":"https://www.smartretry.com/card-validator"}]}
```
