Credit card validator | Validate Your Cards Instantly

Validate your credit card number with our Credit Card Validator. Enter your card number to verify its authenticity, format, and issuer details. Ideal for secure card information validation.


Spaces and dashes are ignored. 12 to 19 digits.
Clear form
Your card number is checked on our server in memory only and is never stored or logged.

Test card numbers

Standard test numbers published by payment processors. They pass the Luhn check but belong to no account, no bank and no person - nothing can be charged to them.

Card type Test number
Visa 4111 1111 1111 1111
Mastercard 5555 5555 5555 4444
American Express 3714 496353 98431
Discover 6011 1111 1111 1117
Diners Club 3056 930902 5904
JCB 3530 1113 3330 0000
UnionPay 6212 3456 7890 1232
Maestro 6759 6498 2643 8453
Broken checksum 4111 1111 1111 1112

The last row is deliberately broken so you can see what a failed checksum looks like.

Card number formats by network

Every network owns a range of leading digits and a fixed set of lengths. This tool uses exactly these rules to name the network.

Network Starts with Length Security code
Visa 4 13, 16, 19 3 digits
Mastercard 51-55, 2221-2720 16 3 digits
American Express 34, 37 15 4 digits
Discover 6011, 644-649, 65 16, 19 3 digits
Diners Club 36, 38, 300-305 14, 16, 19 3 digits
JCB 3528-3589, 2131, 1800 16, 17, 18, 19 3 digits
UnionPay 62 16, 17, 18, 19 3 digits
Maestro 5018, 5020, 5038, 6304, 6759, 6761-6763 12, 13, 14, 15, 16, 17, 18, 19 3 digits
Mir 2200-2204 16 3 digits
Elo 4011, 4312, 4389, 4514, 4573, 5041, 5066, 6277, 6362, 6363 16 3 digits
Hipercard 606282, 3841 16, 19 3 digits
RuPay 6521, 6522, 8172-8175, 5081-5089 16 3 digits
Troy 9792 16 3 digits
Dankort 5019 16 3 digits
Verve 5060, 5078, 6500 16, 18, 19 3 digits
InstaPayment 637-639 16 3 digits
UATP 1 15 3 digits

What is credit card validation?

Credit card validation checks whether a card number is built correctly: the right length, a prefix that belongs to a real card network, and a final check digit that matches the Luhn (mod 10) formula. Payment forms run this check before sending anything to the bank, because it catches typos instantly and for free. It is a structural test only - it says nothing about whether the card exists, has money on it, or has been blocked.

How does credit card validation work?

Network detection

The first digits (the IIN or BIN) identify the network: 4 is Visa, 51-55 and 2221-2720 are Mastercard, 34 and 37 are American Express, and so on.

Length validation

Each network uses fixed lengths - 15 digits for American Express, 16 for Mastercard, 13, 16 or 19 for Visa. A length that does not match the prefix is a typo.

Luhn algorithm check

Every second digit from the right is doubled, the digits are added together, and the total must divide evenly by 10. This catches almost every single-digit typo and most swapped pairs.

Optional expiry and CVV check

If you add an expiry date it is compared with today's date, and the security code is checked against the length the network uses (4 digits for American Express, 3 for everyone else).

What the digits on a card mean

A card number is not random. Under ISO/IEC 7812 it splits into three parts: the issuer identification number, the individual account number and a single check digit.

  • Digit 1 - Major Industry Identifier. Names the industry that issued the card: 4 and 5 are banking and finance, 3 is travel and entertainment, 1 and 2 are airlines.
  • Digits 1-6 (up to 8 since 2022) - Issuer Identification Number. Identifies the network and the specific issuing bank. Merchants use it to route the payment and to guess the card country.
  • Middle digits - individual account number. The issuer's own reference for the account. This is the part that makes each card unique.
  • Last digit - check digit. Calculated from every other digit with the Luhn formula so that any single mistyped digit breaks the total.

A valid number is not a real card

Passing the Luhn check only proves the digits are internally consistent. It cannot tell you whether the card was ever issued, whether it is active, what the balance is, or who owns it. Only the issuing bank knows that, and it only answers through the payment network during a real authorisation. Any site claiming to check a card's balance or status from the number alone is either mistaken or fishing for card data.

What this tool is used for

  • Testing payment forms and checkout flows with numbers that are safe to type in.
  • Catching a typo before you contact support about a declined payment.
  • Learning or teaching how the Luhn algorithm and BIN ranges actually work.
  • Checking that data imported from a form or a CSV file has the right shape.

About the CVV (card verification value)

The CVV, CVC or CID is the short code printed on the card: 3 digits on the back for Visa, Mastercard, Discover and most others, 4 digits on the front for American Express. It is never stored in the magnetic stripe or the chip and must never be stored by a merchant, which is why it proves you physically hold the card. It is not part of the card number and it is not covered by the Luhn checksum.

Security tips

  • Only type a real card number into a site you are actually buying from, and only over HTTPS.
  • Use the published test numbers below for development - never a real card.
  • No legitimate service asks for your card number to "verify" or "reactivate" it by email, chat or phone.
  • Turn on transaction alerts and read your statement every month.
  • Use a virtual or single-use card number for subscriptions and unfamiliar shops.
  • Never store the CVV anywhere - no merchant is allowed to keep it.

Use this tool from your AI agent

Free JSON API and Model Context Protocol (MCP) server. No signup, no API key, CORS open. Designed for Claude, ChatGPT, Cursor, scripts and frontend apps.

curl -X POST https://mate.tools/api/v1/credit-card-validate.php \
  -H "Content-Type: application/json" \
  -d '{"number":"4111 1111 1111 1111"}'
import urllib.request, json

req = urllib.request.Request(
    "https://mate.tools/api/v1/credit-card-validate.php",
    data=json.dumps({"number":"4111 1111 1111 1111"}).encode(),
    headers={"Content-Type": "application/json"},
)
with urllib.request.urlopen(req) as r:
    print(json.load(r))
const r = await fetch("https://mate.tools/api/v1/credit-card-validate.php", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({"number":"4111 1111 1111 1111"}),
});
console.log(await r.json());

Add to claude_desktop_config.json (Claude Desktop), ~/.cursor/mcp.json (Cursor), or any other MCP-compatible client:

{
  "mcpServers": {
    "mate-tools": {
      "command": "npx",
      "args": ["-y", "@mate-tools/mcp-server"]
    }
  }
}
API documentation OpenAPI 3.1 npm 60 req/min · 600 req/hour · 1 MB body cap

Frequently asked questions

The Luhn algorithm, also called the modulus 10 or mod 10 formula, is a checksum used by nearly every card network. Starting from the right, every second digit is doubled; if doubling gives a number above 9, you subtract 9. All the digits are then added up and the number passes if the total divides evenly by 10. It was designed to catch data entry mistakes - it detects every single-digit error and almost every transposition of two neighbouring digits.

No. The number is sent to our server over an encrypted connection, validated in memory and immediately discarded - it is never written to a log, a file or a database. Only the verdict, the detected network and a masked form of the number are sent back to your browser. Even so, this tool is meant for test numbers and education, so there is no reason to type a real card into it.

The validator only checks the structure of the number: length, prefix and checksum. Anybody can generate a string of digits that satisfies all three. Whether a card was actually issued, is active, has funds or has been reported stolen is known only to the issuing bank, and it is only revealed during a real authorisation request through the payment network.

Visa, Mastercard, American Express, Discover, Diners Club, JCB, UnionPay, Maestro, Mir, Elo, Hipercard, RuPay, Troy, Dankort, Verve, InstaPayment and UATP. The network is worked out from the leading digits combined with the length of the number, which is how payment gateways do it.

Yes. Switch to the bulk tab, paste one number per line and every line is validated in a single pass. The results table shows the detected network, the digit count and the verdict for each one, with every number masked so nothing sensitive appears on screen.

The Issuer Identification Number, historically called the Bank Identification Number, is the first six digits of the card (eight for newer ranges). It identifies the network and the bank that issued the card, and merchants use it to route transactions and to work out the card type and country. This tool reads the network from the BIN but does not perform a bank lookup.

It can. Both fields are optional. If you fill in an expiry date it is compared with the current month - a card is valid through the last day of its expiry month. If you fill in a security code the length is compared with what the detected network uses: 4 digits for American Express, 3 for all the others. Neither value is stored.

Almost always a typo - a wrong or missing digit, or two digits swapped. Retype it straight from the card, digit by digit. Some prepaid, gift and loyalty cards also use their own numbering scheme that does not follow the Luhn rules, so they can fail this check while working perfectly in a shop.

Yes. The numbers listed on this page are the public test numbers published by payment processors such as Visa, Stripe and Adyen. They are valid in structure, they are accepted by test environments, and they are attached to no account, so no money can ever move. Never use a real card number for testing.

Yes. The same check is exposed as a free JSON API endpoint, and as an MCP tool for AI agents - the details are in the API panel on this page. As with the web tool, nothing is logged: the response carries only the verdict, the detected network and a masked form of the number.

What is a credit card validator?

A credit card validator checks whether a card number is structurally valid: it confirms the length, identifies the network from the leading digits and verifies the final check digit with the Luhn (mod 10) algorithm. It does not check whether the card is real, active or has funds - only the issuing bank can do that.