Pay with crypto No monthly fee Card details instantly

Free Credit Card Validator

Check whether a card number is correctly formed with the Luhn algorithm, confirm its length for the network, and see which network issued it. Everything runs in your browser.

  • Checks as you type
  • Runs in your browser
  • Shows the Luhn maths
  • 8 card networks

Checked on your device. Nothing you type is sent to our server.

Try a test number:
What it checks

Three checks on every card number

A card number has a fixed structure. The validator tests that structure, the same way a well-built checkout form does before a payment is sent.

1Luhn checksumThe last digit of every card number is a check digit. The Luhn formula confirms it matches the other digits, which catches most typing mistakes.
2Length for the networkVisa numbers are 13, 16 or 19 digits, Mastercard 16, American Express 15. A number with the wrong length for its network cannot be right.
3Network from the first digitsThe opening digits identify the card network, such as 4 for Visa or 34 and 37 for American Express. The first 6 to 8 digits are the BIN.
The maths

How the Luhn algorithm works

The Luhn algorithm, also called the mod 10 check, was described by IBM scientist Hans Peter Luhn in the 1950s. It is part of the ISO/IEC 7812 standard for card numbers and is used by every major card network.

  1. Start from the rightmost digit, the check digit, and move left.
  2. Double every second digit, starting with the one next to the check digit.
  3. If a doubled digit is greater than 9, subtract 9 (so 14 becomes 5).
  4. Add up all the digits, doubled and untouched.
  5. If the total ends in 0, the number passes.

The check catches every single wrong digit and almost every pair of swapped neighbouring digits. The one swap it misses is 09 and 90.

It is not a security feature. The formula is public, so anyone can produce numbers that pass. Its only job is to catch honest typing mistakes before a payment is attempted.

Worked example: 4242 4242 4242 4242
  • Doubled: 4 × 2 = 8
  • Kept as is: 2
  • Check digit

8 + 2 repeated eight times = 80. 80 ends in 0, so the number passes.

Reference

Card number formats by network

How each network's numbers start, how long they are, and where the security code is printed.

Card number prefixes, lengths and security codes
NetworkStarts withLengthSecurity code
Visa413, 16 or 19 digits3 (back)
Mastercard51–55, 2221–272016 digits3 (back)
American Express34, 3715 digits4 (front)
Discover6011, 644–649, 6516–19 digits3 (back)
JCB3528–358916–19 digits3 (back)
UnionPay6216–19 digits3 (back)
Diners Club36, 300–305, 38–3914–19 digits3 (back)
Mir2200–220416–19 digits3 (back)

American Express numbers are grouped 4-6-5 and 14-digit Diners Club numbers 4-6-4. Most others are printed in groups of four.

For developers

Test card numbers

Payment providers such as Stripe publish these numbers for their test modes. They pass the Luhn check and have the right length, so they are ideal for testing checkout forms.

They only work in a provider's test or sandbox mode and can never be charged for real. Use any future expiry date and any security code of the right length.

Click a number to run it through the validator.

Published test card numbers
NetworkNumber
Visa
Visa
Mastercard
Mastercard (2-series)
American Express
Discover
JCB
Diners Club
UnionPay
Valid is not approved

A valid number is only the first step

A number can pass every check here and the payment can still be declined. When you pay online, the merchant and the issuing bank also check:

Expiry dateMust match the card and be in the future.
Security codeThe CVV or CVC must match what the bank has on file.
Billing addressMany merchants compare the postcode with the bank's record.
3D SecureThe bank may ask you to confirm the payment in its app or by code.
Funds and statusThe card must be active with enough balance or credit.
Merchant rulesSome merchants refuse prepaid or foreign-issued cards.

If a merchant keeps declining a valid card, look up its BIN to see the card type and country, then check the BIN or compare virtual cards by network and country.

Use cases

Who uses a card number validator

DevelopersTest checkout and billing forms with published test numbers, and confirm your own Luhn and length checks behave the same way.
Support and operations teamsCatch a mistyped number taken over the phone or from a form before it is submitted and declined.
CardholdersCheck that you copied your card number correctly when a site says it is invalid, and see which network your card belongs to.Compare Qwikvcc cards →

Your number stays on your device

This validator is plain JavaScript that runs in your browser. The number you type is never sent to Qwikvcc or anyone else, and we never ask for an expiry date, security code or name. The "Look up this BIN" link only sends the first six digits, and only if you click it. As with any website, only check numbers you own or published test numbers.

FAQ

Card validator questions

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

Contact support
What does a credit card validator check?

It checks the format of a card number: whether it passes the Luhn checksum, whether its length is right for its network, and which network the first digits belong to. It cannot see the card account itself.

If a number passes, does that mean the card is real?

No. Passing means the number is well formed, nothing more. Whether the card exists, is active, has funds or will be approved is only known to the issuing bank when a payment is authorised.

How does the Luhn algorithm work?

Starting from the right and skipping the last digit, double every second digit. If doubling gives a number above 9, subtract 9. Add up all the digits, including the last one. If the total is a multiple of 10, the number passes.

Is it safe to enter a card number here?

The check runs entirely in your browser and the number is never sent to our server. Even so, only check your own card or a published test number, and never enter an expiry date or CVV on any validator page. This one does not ask for them.

Why does my real card number fail?

Almost always because of a typo: a wrong, missing or extra digit, or two digits swapped. Copy the number again from the card or your banking app. Numbers on statements and receipts are usually masked and cannot be checked.

Can a website tell whether a card is "live" or has money on it?

Not from the number. Only the issuing bank knows the balance and status. Sites that claim to check whether a card is live do it by attempting charges on it, which is card testing and is illegal.

Which card networks are supported?

Visa, Mastercard (including 2-series numbers), American Express, Discover, JCB, UnionPay, Diners Club and Mir. Numbers from other networks are still checked with Luhn, but their length cannot be confirmed.

Where can I get test card numbers?

Payment providers publish test numbers for their sandbox or test mode, like the ones listed on this page. They pass validation but only work in test mode and can never be charged for real.

More free tools

Related payment tools

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