Talk to us
Questions about a card or an order? Pick how you'd like to reach us.
Free credit card number validator · No sign-up
Check whether a credit card number is valid in one step. Enter a card number to see if it passes the Luhn algorithm, has the right length and which network issued it, all in your browser. Your number is never sent anywhere.
Your result appears hereLuhn check, length and card network for any card number, with the maths shown step by step.
A credit card validator is a free online tool designed to check the validity of credit card numbers. It runs the Luhn algorithm (a mod 10 checksum), confirms the length for the network and names the network from the opening digits. It can't verify whether the card is real, active or funded.
What it checks
The validator uses three checks to quickly verify whether the card number is valid in format: the Luhn checksum, the length for the card network, and the network from the opening digits. A number is considered valid only when all three pass. A well-built checkout form runs the same checks on numbers before processing a payment.
The last digit of every card number is a check digit. A simple formula confirms it fits the others, which catches most typing mistakes.
Visa numbers have 13, 16 or 19 digits, Mastercard 16 and Amex 15. A number with the wrong length for its network can't be right.
The opening digits name the network, such as 4 for Visa or 34 and 37 for Amex. The first 6 to 8 are the issuer's BIN.
How to use it
Type or paste the 12 to 19 digits from the front of the card or your banking app. Spaces and dashes are fine, and the number is grouped as you type.
Each check shows pass or fail. Green means the credit card number is valid in format; red points to a typo or a wrong length.
Compare an invalid number digit by digit. For a valid one, open the maths, copy a masked result or show the bank that issued it.
The maths
The Luhn algorithm, or mod 10 check, is a checksum formula used to validate identification numbers such as card numbers. Starting from the right, every second digit is multiplied by 2, and 9 is subtracted from any result above 9. The number passes when the total of all the digits is a multiple of 10.
Hans Peter Luhn, a scientist at IBM, filed the method in 1954 and was granted the patent in 1960. ISO/IEC 7812 now requires it for payment card numbers, so every major credit card network uses it.
It catches every single mistyped digit and almost every swap of two neighbouring digits. It misses the swap 09 ↔ 90 and "twin" errors such as 22 → 55, 33 → 66 or 44 → 77.
It is not a security feature either. The formula is public, so anyone can produce numbers that pass. That is why a valid result never proves a card exists.
Doubled: 1+1+1+1+1+1+8+8 = 22. Kept: 5+5+5+5+5+5+4+4 = 38. Total 60 ends in 0, so the number passes.
For developers
To validate credit card numbers with the Luhn algorithm in code, strip everything except digits, run the loop from the right and check the length. The two functions below do what this page does. The same loop ports directly to C, C++, Java or PHP.
function luhnCheck(number) {
const digits = String(number).replace(/\D/g, '');
let sum = 0;
for (let i = 0; i < digits.length; i++) {
let d = Number(digits[digits.length - 1 - i]);
if (i % 2 === 1) { // every second digit from the right
d *= 2;
if (d > 9) d -= 9;
}
sum += d;
}
return digits.length >= 12 && sum % 10 === 0;
}
luhnCheck('4242 4242 4242 4242'); // true
luhnCheck('4242 4242 4242 4241'); // false
def luhn_check(number: str) -> bool:
digits = [int(c) for c in number if c.isdigit()]
total = 0
for i, d in enumerate(reversed(digits)):
if i % 2 == 1: # every second digit from the right
d *= 2
if d > 9:
d -= 9
total += d
return len(digits) >= 12 and total % 10 == 0
luhn_check("4242 4242 4242 4242") # True
luhn_check("4242 4242 4242 4241") # False
Validating numbers client-side gives instant feedback and can help users fix typos before they pay, but it isn't a payment check: your payment provider still validates the card on its server. For production forms, a maintained library such as Braintree's open-source card-validator also checks card types, security code length and expiry dates.
First digitMajor industry identifier (MII)
First 6–8 digitsIssuer identification number (IIN or BIN)
MiddleIndividual account number
Last digitCheck digit
Reference
A card number has three parts. The first 6 to 8 digits are the issuer identification number (IIN), also called the bank identification number (BIN), which identifies the card scheme and the issuing institution. Next comes the account number, and the final position holds the check digit.
The first digit on its own is the major industry identifier (MII): 3 for travel and entertainment cards such as Amex, 4 and 5 for banking, and 6 for merchandising and banking. Card issuers have also used 8-digit BINs since 2022, but card numbers did not get longer.
| Network | Starts with | Length (digits) | Security code (digits) | Printed as |
|---|---|---|---|---|
| Visa | 4 | 13, 16 or 19 | 3, back (CVV2) | 4-4-4-4 |
| Mastercard | 51–55, 2221–2720 | 16 | 3, back (CVC2) | 4-4-4-4 |
| American Express | 34, 37 | 15 | 4, front (CID) | 4-6-5 |
| Discover | 6011, 644–649, 65 | 16–19 | 3, back (CID) | 4-4-4-4 |
| JCB | 3528–3589 | 16–19 | 3, back (CAV2) | 4-4-4-4 |
| UnionPay | 62 | 16–19 | 3, back (CVN2) | 4-4-4-4 |
| Diners Club | 36, 300–305, 38–39 | 14–19 | 3, back | 4-6-4 |
| Mir | 2200–2204 | 16–19 | 3, back (CVP2) | 4-4-4-4 |
Some ranges are shared through partnerships. Discover accepts many UnionPay and Diners Club cards, for example, so the network that issued a card and the one that processes a payment can differ.
For developers and QA
Payment providers such as Stripe publish test numbers for their sandbox or test mode. Each one is correctly formed and has the right length, so you can use credit card test numbers on a checkout form without moving money. They only work in test mode and are declined in live mode.
Use any future date as the expiry and any 3 digits as the security code (4 for Amex). Click a number to run it through the validator.
A credit card number generator outputs random numbers that look valid. They belong to no account, so they fail at every real checkout, and using them for free trials breaks most sites' terms. Published test numbers are the better choice, because each provider documents exactly how its numbers behave.
| Network | Test number |
|---|---|
| Visa | |
| Visa | |
| Visa (debit) | |
| Mastercard | |
| Mastercard (2-series) | |
| American Express | |
| Discover | |
| JCB | |
| Diners Club | |
| UnionPay |
Valid is not approved
Validation checks the number's format. Verification checks the card itself: only the issuing bank can verify card details, and it does so during a transaction. A number can pass every check on this page and still be declined because the card has expired, the security code or address doesn't match, or there are no funds.
| Check | Uses | Confirms | Can't confirm |
|---|---|---|---|
| Card validator (Luhn) This page | The card number | The number is well formed for its network | Whether the card exists or works |
| BIN lookup | First 6–8 digits | Network, bank, card type and country | Anything about the cardholder or balance |
| CVV and expiry | Security code and expiry date | The payer has the card details | Whether the payer owns the card |
| AVS | Billing address | The address matches the issuer's records | Who is using the card |
| 3-D Secure | Approval in the bank's app or by code | The cardholder approved this payment | Whether funds are available |
| Authorization | All card details and the amount | The issuer approves the transaction | Whether a chargeback follows later |
Sites that promise to check whether a card is "live" do it by attempting small charges on it. That is card testing: it is illegal on cards you don't own, it causes fraudulent transactions on real accounts, and issuers block cards that are tested this way. A legitimate credit card checker, like this one, only checks the format.
Checkout forms validate the number first, which cuts failed authorizations and their fees. To flag potential fraud and prevent fraudulent transactions, merchants add AVS, 3-D Secure and limits on repeated attempts. See what a lost dispute costs in the chargeback calculator.
Troubleshooting
Almost always because of a typo. The checksum catches any single wrong digit and most swapped pairs, so an invalid result means the entered number differs from the card. Compare it digit by digit with the card or your banking app, then check these common causes.
Then the number isn't the problem. Cards expire, the security code or billing address may not match, 3-D Secure may have failed, or the merchant may not accept prepaid debit cards or the card's country. Look up the BIN to see the card type and the bank behind it.
Every Qwikvcc virtual card page lists its network, issuing country and currency before you buy, so you can check it fits before using a credit card online.
Browse virtual cardsPrivacy
It's safe when the check runs in your browser and the site never asks for the expiry date or CVV. This validator is plain client-side JavaScript: the number never leaves your device, isn't stored and isn't added to the page address. Some online checkers put the full number in the URL, where it ends up in server logs and browser history.
Even so, only check your own cards or published test numbers, and never type credit card details such as the expiry date or security code into any validator.
Use cases
Check credit card test data, compare your own code with a known result, and copy the maths into a bug report.
Catch a mistyped number taken by phone or from a form before it turns into a failed transaction.
Spot invalid card numbers in sign-up or order data, a common sign of bots and generated numbers.
Find out why a site says your number is invalid, and see which network your card uses.
FAQ
Can't find your answer? Our support team is happy to help.
Contact supportYes. It is free, with no sign-up and no limit on checks. Each check runs instantly in your browser, so you can validate as many numbers as you like.
No. A valid result only means the number is well formed: the digits add up correctly and the length is right for its network. Only the issuing bank knows whether the card exists, is active or has funds, and it answers that when a payment is authorized.
The tool strips everything except digits, then runs three checks. The Luhn algorithm confirms the final digit, the length is compared with the network's lengths, and the opening digits identify the network. All three must pass.
Almost always because of a typo: a wrong digit, two digits swapped, or a digit missing or added. Compare the number with the card or your banking app digit by digit. Masked numbers from statements and receipts can't be validated because most digits are hidden.
The check runs on your device. The number is never sent to our server, never stored and never added to the page address. Even so, only check your own card or a published test number, and never enter the expiry date or CVV on any validator.
It means the merchant's form or payment provider rejected the card details before charging. Common causes are a mistyped number, an expired card, a wrong security code or a billing address that doesn't match. If the number passes here, check the other details, then contact your bank.
You can identify it, but not validate it. The first 6 to 8 digits show the network, bank, card type and country, so use the BIN checker for that. A full check needs the whole number, because the final digit depends on all the others.
It is another name for the CVV, CVC or CID security code: 3 digits on the back of most cards, or 4 on the front of American Express cards. It is not part of the card number and the formula doesn't use it, which is why this page never asks for it.
It recognises 8 networks, including Visa, Mastercard (with 2-series numbers), American Express, Discover, JCB, UnionPay, Diners Club and Mir. It works for any credit card or debit card on them, including prepaid and virtual cards. Other numbers are still checked, but their length can't be confirmed.
No, and none can from the number alone. Sites that claim to check whether a card is "live" attempt charges on it. That is card testing, which is illegal on cards you don't own and gets the card blocked by its issuer.
More free tools