Credit Card Validator: Luhn Check & Card Type Detector
Validators
Validate credit card numbers using the Luhn algorithm. Detects Visa, Mastercard, Amex, Discover, and more. No data is sent to any server.
Format and Luhn checks only; this does not authorize a payment. Use synthetic test numbers. Never enter real card numbers.
Enter a synthetic test number to check its format. All checks run in your browser.
How to use this tool
- Choose a synthetic test number. Select one of the sample buttons or enter a synthetic test number. Never enter a real payment card number.
- Review the format checks. Read the detected network, Luhn checksum, and digit length. The number must pass both the checksum and the recognized network length to show Valid.
- Use the check digit as a test aid. If the Luhn check fails, the tool shows the check digit calculated from the other digits. This is a format hint for synthetic test data, not payment authorization.
Credit Card Number Validator
Use a synthetic test number to check whether it passes the Luhn checksum, identify the card network (Visa, Mastercard, American Express, Discover, etc.), and verify that the length matches the expected format.
The Luhn Algorithm
The Luhn algorithm (also known as the "mod 10" algorithm) is a simple checksum formula used to validate identification numbers such as credit card numbers. It can detect any single-digit error and most transpositions of adjacent digits. It is not a cryptographic check: it only protects against accidental errors.
Privacy
All validation runs entirely in your browser using JavaScript. Your card number is never sent to any server. The test numbers shown are synthetic numbers for demonstration only.
Luhn algorithm: step-by-step walkthrough
Using the number 4539 1488 0343 6467 as an example:
- Starting from the rightmost digit (the check digit), double every second digit going left.
- If a doubled value exceeds 9, subtract 9 from it.
- Sum all digits (original and doubled).
- If the total is divisible by 10, the number is valid.
4 5 3 9 1 4 8 8 0 3 4 3 6 4 6 7 (original)
8 5 6 9 2 4 7 8 0 3 8 3 3 4 3 7 (doubled alternating, subtract 9 if > 9)
Sum = 8+5+6+9+2+4+7+8+0+3+8+3+3+4+3+7 = 80
80 mod 10 = 0 -> Valid Card type IIN/BIN prefixes
| Network | Starts with | Length |
|---|---|---|
| Visa | 4 | 13, 16, or 19 digits |
| Mastercard | 51–55 or 2221–2720 | 16 digits |
| American Express | 34 or 37 | 15 digits |
| Discover | 6011, 622126–622925, 644–649, or 65 | 16 or 19 digits |
| Diners Club | 300–305, 36, or 38 | 14 digits |
| JCB | 3528–3589 | 16–19 digits |
| UnionPay | 62, except the Discover range above | 16–19 digits |
| Maestro | 6304, 6759, or 6761–6763 | 12–19 digits |
These ranges are used only to estimate the network from the number's opening digits. The Discover 622126–622925 range overlaps the broader UnionPay 62 prefix, so this checker checks Discover first and treats other matching 62 prefixes as UnionPay. Issuer ranges may change, and a network match does not verify an account.
Test card numbers for developers
These synthetic numbers pass the Luhn check but are not real cards and cannot be charged:
- Visa: 4242 4242 4242 4242 (Stripe test card)
- Mastercard: 5555 5555 5555 4444
- Amex: 3782 822463 10005
- Discover: 6011 1111 1111 1117
Frequently asked questions
Does a valid result mean the card is active?
No. A valid result means only that the number passes the Luhn checksum and matches a recognized network prefix and length. This browser-only format check cannot confirm an account, available credit, or whether a payment would be authorized.
Should I enter a real card number?
No. Use synthetic test numbers such as the examples on this page. Never enter real payment card data into this tool or another third-party validator.
Which card networks can this tool recognize?
It checks common prefix patterns for Visa, Mastercard, American Express, Discover, Diners Club, JCB, UnionPay, and Maestro. Network ranges can overlap or change, so the detected name is a format hint rather than confirmation from an issuer.
More validators
- IBAN ValidatorValidate IBAN country codes, lengths, BBAN formats and MOD-97 checks, or calculate check digits from a BBAN. Works locally for 86 countries.
- ISBN ValidatorValidate ISBN-10 and ISBN-13 check digits in your browser. Convert between formats and catch common entry errors without querying book databases.
- MAC Address ValidatorValidate any MAC address format (colon, hyphen, Cisco dot, raw hex). Identifies multicast, broadcast, and locally-administered addresses. Shows the OUI prefix.
- UUID ValidatorValidate UUIDs and decode v1, v6, and v7 timestamps, clock sequence, and node locally. Supports URNs, braces, compact forms, and common UUID variants.
- VIN DecoderDecode any 17-character VIN instantly. Shows manufacturer region, model year, plant code, and validates the NHTSA check digit. 100% client-side.