DNSfinder.net
Payments

Credit Card Validator

Check whether a card number is well formed before it reaches a payment form. The validator runs the Luhn checksum, matches the leading digits against known network ranges and confirms the length fits that network, all in your browser as you type. It also splits the number into its industry digit, issuer prefix and check digit. A pass means the digits are consistent. It says nothing about whether the account exists, is open or has funds.

Loading Credit Card Validator...

Querying live edge resolvers and network infrastructure...

How to use the Credit Card Validator

  1. Type or paste a number into the Card number box. Spaces and dashes are stripped and the digits are regrouped as you go.
  2. Read the four tiles: Result, Network, Luhn checksum and Length. Result stays at Too short until 12 digits are in.
  3. Check the Number anatomy table for the industry digit, issuer prefix, check digit and expected security code length.
  4. Click a Test numbers button (Visa, Mastercard, Amex, Discover or JCB) to load a sample number when testing a form.

What to look for

Valid needs two passes

Result reads Valid only when the Luhn checksum passes and the digit count is one the detected network issues. A 15 digit number starting with 4 can pass the checksum and still be Invalid, because Visa numbers have 13, 16 or 19 digits. The Length tile is flagged to show which test failed.

Network from the leading digits

The network is read from the prefix alone: 4 is Visa, 34 and 37 are American Express, 51 to 55 and 2221 to 2720 are Mastercard. Ten networks are recognised, including Discover, JCB, Diners Club, UnionPay, Maestro, RuPay and Mir. Any other prefix shows Unknown and is judged on checksum and a 12 to 19 digit length.

Typed here, checked here

The checks are plain JavaScript running in the page, and typing triggers no request, so the number is not transmitted, logged or stored. Even so, use the test numbers instead of a live card wherever a test will do. It is the safer habit on any website.

Guide

How card number validation works and what a pass proves

How the Luhn checksum is calculated

The Luhn algorithm, also called mod 10, is specified for payment cards in ISO/IEC 7812-1. Start at the rightmost digit and move left, doubling every second digit. When doubling gives a two digit result, subtract 9. Add everything up. If the total ends in zero, the number passes. The last digit of every card is a check digit chosen to make that happen.

Take 4111 1111 1111 1111. The doubled positions hold the 4 and seven 1s, which become 8 and seven 2s, a subtotal of 22. The other eight digits are all 1s and add 8. The total is 30, so the number passes. Change the final 1 to a 2 and the total becomes 31, which fails.

What the checksum catches and what slips through

Luhn was designed to catch keying mistakes. It detects every single wrong digit and almost every swap of two neighbouring digits. The one swap it misses is 09 for 90. It also misses a few doubled-digit errors, such as 22 typed as 55. For a number copied from a card or read out over the phone, that covers the mistakes people make most.

It is not a security feature. The formula is public, one in every ten random digit strings passes it, and card number generators produce passing numbers on demand. Treat a pass as evidence that nothing was mistyped, and nothing more.

Reading the tiles and the anatomy table

Result is the verdict: Too short below 12 digits, then Valid or Invalid. Network names the brand matched from the prefix. Luhn checksum shows Passes or Fails on its own, and Length shows the digit count with the lengths that network uses underneath, for example 15 for American Express or 13, 16, 19 for Visa. Result needs both of those to pass.

Number anatomy appears once six digits are in. The first digit is the major industry identifier: 3 for travel and entertainment, 4 and 5 for banking. The issuer ID is the leading block of up to eight digits that identifies the bank. The account digits in the middle are masked as dots, the last digit is the check digit, and the security code length is 4 for American Express and 3 for the rest.

Testing a checkout form with sample numbers

The five buttons load numbers that payment processors publish for test environments: 4111 1111 1111 1111 for Visa, 5555 5555 5555 4444 for Mastercard, 3782 822463 10005 for American Express, 6011 1111 1111 1117 for Discover and 3530 1113 3330 0000 for JCB. They pass every format check and belong to no account, so a live gateway declines them.

Use them to confirm that your form accepts 15 digit Amex numbers, copes with spaces and dashes, and switches the brand logo as the prefix is typed. Then break one on purpose: alter a single digit and check that the form rejects it. Client-side validation saves a round trip to the processor for an obvious typo, but the processor's answer is the one that counts.

What a valid result does not tell you

The validator cannot see whether a number was ever issued, whether the account is open, what its limit or balance is, who holds it or when it expires. There is no expiry date or security code field, because neither can be checked by arithmetic. Only the issuing bank answers those questions, during an authorisation request sent through a payment processor.

It does not name the bank either. The issuer prefix is shown, but mapping it to an institution needs a database. Put the first six to eight digits into the BIN checker for the issuer, card type and country. Network ranges also change over time, so a newly assigned prefix can show Unknown here and still belong to a real card.

Knowledge Base & FAQ

Credit Card Validator FAQs

Common questions about the credit card validator.

No. Valid means the digits satisfy the Luhn formula and the length suits the network, which any made-up number can do. Whether a card exists, is active or has money behind it is known only to the issuing bank and is checked when a payment is authorised.