Credit Card Number Validator
Check a card number with the Luhn test and spot Visa, RuPay or Amex
Runs entirely in your browser. Nothing you type or upload is sent to us or stored. How we handle privacy
- 4111 1111 1111 1111
- 5555 5555 5555 4444
- 2223 0031 2200 3222
- 3782 822463 10005
- 6073 8499 1234 5674
- 6011 1111 1111 1117
- 3622 720627 1667
- 3530 1113 3330 0000
Runs entirely in your browser. Nothing you type or upload is sent to us or stored.
Results are for general guidance. Please check anything important before relying on it. Terms of use
How to Use
- Type or paste a card number into the box. Spaces and dashes are fine; the number is grouped as you type (4-6-5 for American Express).
- Read the result: whether the number passes the Luhn check, which network its first digits belong to, and whether the length is right for that network.
- If it fails, the red note shows which check digit the number needs. Open How the Luhn check worked to see every doubled digit and the total.
- Developers can tap Use next to any of the test numbers to fill the box with a number that passes the check.
What this credit card validator checks
This credit card number validator checks whether a debit or credit card number is well formed. It runs the Luhn check that every Visa, Mastercard, RuPay and American Express number has to pass, works out the card network from the first digits, and compares the length with what that network issues. Developers use it to test payment forms; others use it to spot a typo before paying.
It checks the arithmetic of the number and nothing more. It can't tell whether a card exists, has been blocked, belongs to a particular person or has any money or limit on it. Only the issuing bank knows that, and it only answers through a real payment.
How the Luhn check works
The last digit of a card number is a check digit, worked out from all the others with the Luhn formula (also called mod 10), which IBM engineer Hans Peter Luhn devised in the 1950s and which the card numbering standard ISO/IEC 7812 uses.
2. Double every second digit: the 2nd, 4th, 6th... from the right.
3. If doubling gives more than 9, subtract 9 (16 becomes 7).
4. Add up all the digits.
5. The number is valid if the total is a multiple of 10.
Take the well-known test number 4111 1111 1111 1111. The doubled digits are the 4 and seven of the 1s: 8 + 7 ร 2 = 22. The other eight 1s add 8. The total is 30, a multiple of 10, so it passes. Change the last digit to 2 and the total becomes 31, which fails. The tool would then tell you the last digit must be 1.
Luhn catches any single mistyped digit and almost every swap of two neighbouring digits (09 and 90 is the exception). It isn't a security feature: anyone can make up a number that passes.
Card networks by first digits
The first 6 or 8 digits are the Issuer Identification Number (IIN, often called the BIN). They identify the network and the issuing bank.
| Network | Starts with | Length |
|---|---|---|
| Visa | 4 | 13, 16 or 19 |
| Mastercard | 51 to 55, 2221 to 2720 | 16 |
| RuPay | 60, 65, 81, 82, 508 | 16 |
| American Express | 34, 37 | 15 |
| Discover | 6011, 644 to 649, 65 | 16 to 19 |
| Diners Club | 300 to 305, 36, 38 | 14 to 19 |
| JCB | 3528 to 3589 | 16 to 19 |
| Maestro | 50, 56 to 69 | 12 to 19 |
Some ranges overlap. A card starting with 65 may be RuPay or Discover (the two networks have a partnership), and Maestro shares part of the 6 range. The tool shows the most likely network and mentions the others. In India, cards beginning with 60, 65, 81, 82 or 508 are usually RuPay, the network run by NPCI. RuPay credit cards can also be linked to UPI.
For developers
Run Luhn in your checkout form to catch typos instantly, before a failed payment. Don't block a card just because the network is unknown: new ranges appear, and the payment gateway will reject a bad number anyway. Use the test numbers on this page for form validation only. For actual payment tests, use the sandbox card numbers your gateway publishes, because the gateway only accepts those in test mode.
Never log or store full card numbers. Card data rules (PCI DSS) are strict, and since 1 October 2022 RBI rules have not allowed merchants in India to store customers' card numbers; they keep an encrypted token instead. This page follows the same idea: the number you type stays in memory in this tab. It isn't saved, put in the address bar or sent anywhere.