Free Credit Card Number Validator (Luhn)

Free credit card validator: run the Luhn check, detect Visa, Mastercard, Amex, Discover, JCB, RuPay and more, and use official test card numbers. Offline.

  • No upload, 100% private
  • Instant, in your browser
  • 100% free, no signup
Loading tool…
Read the complete guideHow the Luhn Algorithm Validates Credit Card Numbers (With Code) →

About the Credit Card Validator tool

Developers building checkout forms, testers preparing payment scenarios and support staff reading a number over the phone often need to know one thing: is this card number even well-formed? Every major card number ends with a Luhn check digit, and its first digits (the IIN or BIN) identify the network, which also sets the valid lengths.

Type or paste a number and this validator runs the Luhn mod-10 checksum, detects the network from its prefix (Visa, Mastercard including the 2-series, American Express, Discover, JCB, Diners Club, UnionPay, Maestro, RuPay and Mir), checks the length for that network and formats the number the way it is printed on the card. If the checksum fails, it tells you which final digit would have been valid, which usually points to a typo.

To be clear: this tool only checks the structure of the number. It never contacts a bank or payment network, so it cannot tell whether a card exists, is active or has funds. For testing, use the official sandbox numbers from Stripe and Braintree listed on the page.

How to use Credit Card Validator

  1. Type or paste a number into “Card number”. Spaces and dashes are ignored.
  2. Read the badge: “Valid structure” or “Invalid”, plus the detected network.
  3. Check the three results for the Luhn checksum, issuer prefix and length.
  4. Look at the table for the major industry identifier, IIN/BIN, check digit and security code length.
  5. Click any of the “Official test numbers” to try a known-good example.

Features

Luhn checksum

Validates the mod-10 check digit and shows the digit that would make a failing number pass.

Network detection

Recognises ten networks by IIN range, checking specific ranges like RuPay and Mir before broad ones.

Length rules

Checks the number of digits allowed for the detected network, such as 15 for Amex.

Card-style formatting

Groups digits as printed on the card, for example 4-6-5 for American Express.

Official test numbers

One-click examples from Stripe and Braintree's public test documentation.

When to use it

  • Add client-side validation to a checkout form and check your implementation.
  • Pick the right sandbox card number for each network when testing payments.
  • Catch a mistyped card number before submitting an order by phone.
  • Explain how the Luhn algorithm works in a programming class.

Frequently asked questions

Does a valid result mean the card is real?

No. It only means the number is correctly formed. Only the card issuer can say whether an account exists, and this tool never contacts one.

What is the Luhn algorithm?

A checksum invented at IBM in 1954. Starting from the right, every second digit is doubled (subtracting 9 if above 9), all digits are added, and a valid number totals a multiple of 10. It catches single-digit typos and most swapped digits.

Is it safe to enter a real card number?

The check runs in your browser and nothing is sent or stored. As a general rule, only enter real card details on sites you trust, and use test numbers for development.

Can I use the test numbers to buy something?

No. They only work in the test or sandbox modes of Stripe and Braintree and are declined by real payment systems.

Why is my UnionPay card shown as failing Luhn?

Some older UnionPay cards were issued without a Luhn check digit, so a failure there does not always mean a typo.

Related tools