Pay with crypto No monthly fee Activation applies

Free credit card number validator · No sign-up

Free Credit Card Validator & Card Number Checker

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.

0/16

Checked on your device. Nothing you type is sent, saved or added to the address bar.

Try a test number

Your result appears hereLuhn check, length and card network for any card number, with the maths shown step by step.

  • Instant results as you type
  • Never sent, saved or put in a URL
  • Visa, Mastercard, Amex + 5 more
  • Shows the maths step by step

What is a credit card validator?

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.

Algorithm
Luhn (mod 10)
Lengths checked
12–19
Networks
8
Numbers sent to us
0

What it checks

What does a credit card validator check?

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.

Luhn checksum

The last digit of every card number is a check digit. A simple formula confirms it fits the others, which catches most typing mistakes.

Length for the network

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.

Network from the prefix

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.

A valid card number tells you

  • The number was typed or copied correctly
  • It has a real length for its network
  • Which network it belongs to, and where the security code is printed

It can't tell you

  • Whether the card exists, is active or has funds
  • Who the cardholder is, or the expiry date and security code
  • Whether a payment will be approved

How to use it

How to validate a credit card or debit card number in 3 steps

  1. Enter the number

    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.

  2. Read the three checks

    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.

  3. Fix it or dig deeper

    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

How the Luhn algorithm validates a credit card number

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.

  1. Start with the rightmost digit and leave it as it is.
  2. Moving left, double every second digit.
  3. If a doubled digit is above 9, subtract 9 (so 7 × 2 = 14 becomes 5).
  4. Add up all the digits, doubled and untouched.
  5. If the total ends in 0, the number passes.

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.

What the Luhn check catches, and what it misses

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.

Worked example: 5555 5555 5555 4444
  • Doubled: 5 × 2 = 10, 10 − 9 = 1
  • Kept as is
  • Check digit

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

How to validate credit card numbers in JavaScript or Python

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.

JavaScript
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
Python
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

Credit card number format by card network: Visa, Mastercard, American Express

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.

Prefixes, lengths and security codes
NetworkStarts withLength (digits)Security code (digits)Printed as
Visa413, 16 or 193, back (CVV2)4-4-4-4
Mastercard51–55, 2221–2720163, back (CVC2)4-4-4-4
American Express34, 37154, front (CID)4-6-5
Discover6011, 644–649, 6516–193, back (CID)4-4-4-4
JCB3528–358916–193, back (CAV2)4-4-4-4
UnionPay6216–193, back (CVN2)4-4-4-4
Diners Club36, 300–305, 38–3914–193, back4-6-4
Mir2200–220416–193, 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

Test credit card numbers for payment forms

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.

Use credit card test numbers, not a generator

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.

Published test card numbers
NetworkTest number
Visa
Visa
Visa (debit)
Mastercard
Mastercard (2-series)
American Express
Discover
JCB
Diners Club
UnionPay

Valid is not approved

Credit card validation vs verification: a valid number isn't a working card

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.

What each card check uses and confirms
CheckUsesConfirmsCan't confirm
Card validator (Luhn) This pageThe card numberThe number is well formed for its networkWhether the card exists or works
BIN lookupFirst 6–8 digitsNetwork, bank, card type and countryAnything about the cardholder or balance
CVV and expirySecurity code and expiry dateThe payer has the card detailsWhether the payer owns the card
AVSBilling addressThe address matches the issuer's recordsWho is using the card
3-D SecureApproval in the bank's app or by codeThe cardholder approved this paymentWhether funds are available
AuthorizationAll card details and the amountThe issuer approves the transactionWhether a chargeback follows later

What about "live or dead" card checkers?

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.

How merchants verify cards before a transaction

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

Why is my credit card number invalid?

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.

  • One digit mistyped. The most common cause, especially when copying by hand.
  • Two digits swapped. For example, 42 typed as 24.
  • A digit missing or extra. The length no longer matches the network.
  • A masked number. Statements and receipts hide most digits, so they can't be checked.
  • Extra details pasted in. The expiry date and security code are separate fields, not part of the card number.

Valid here but declined when using a credit card?

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.

Need a card that the merchant accepts?

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 cards

Privacy

Is it safe to use a credit card validator?

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.

  • Runs on your device. Nothing is sent when you validate.
  • Never in a URL. The page address doesn't change, so the number can't leak through history or logs.
  • Nothing stored. No cookie or browser storage holds credit card information; reload and it's gone.
  • Bank lookup is optional. Only the first 6 digits of the card number are sent, and only when you click "Show issuing bank".

Use cases

Who uses a credit card checker tool?

Developers and QA

Check credit card test data, compare your own code with a known result, and copy the maths into a bug report.

Checkout and support teams

Catch a mistyped number taken by phone or from a form before it turns into a failed transaction.

Fraud and risk analysts

Spot invalid card numbers in sign-up or order data, a common sign of bots and generated numbers.

Cardholders

Find out why a site says your number is invalid, and see which network your card uses.

FAQ

Credit card validator FAQ

Can't find your answer? Our support team is happy to help.

Contact support

Is this credit card validator free?

Yes. 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.

Does a valid number mean the card is real or has money on it?

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.

How does credit card validation work?

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.

Why is my credit card number marked as invalid?

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.

Is it safe to enter my card number here?

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.

What does "credit card validation failed" mean at checkout?

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.

Can I check credit card details with just the BIN?

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.

What is a credit card validation code?

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.

Which types of credit card can the validator detect?

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.

Can a credit card validator tell if a card is live or dead?

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.

We may use cookies or any other tracking technologies when you visit our website, including any other media form, mobile website, or mobile application related or connected to help customize the Site and improve your experience. We use cookies to keep this site working and to improve your experience.

Learn More Accept