Credit Card Validator
Luhn checksum · card type detection · 100% client-side
Test:
Enter a card number above or click a test card to get started.
⚠ For testing only. These are standard test card numbers — never enter real card data online.
About
The Credit Card Validator uses the Luhn algorithm (also known as the "modulus 10" or "mod 10" algorithm) to verify the mathematical validity of a card number. It also detects the card brand by matching known issuer identification patterns (IIN prefixes) and validates that the number length matches the expected length for that brand. All processing happens in your browser — no card data is ever transmitted to a server.
How to use
- 1 Type or paste a card number into the input field — spaces are accepted and stripped automatically.
- 2 The tool formats the number with proper group spacing as you type (4-4-4-4 for Visa, 4-6-5 for Amex, etc.).
- 3 The card brand (Visa, Mastercard, Amex, Discover, JCB, UnionPay, Maestro, RuPay, Diners) is detected in real time.
- 4 The Luhn checksum is computed and shown as Pass or Fail.
- 5 The digit count is checked against the valid lengths for the detected brand.
- 6 Use the quick-test buttons to load known-valid test card numbers for each brand.
- What is the Luhn algorithm?
- The Luhn algorithm is a simple checksum formula used to validate credit card numbers, IMEI numbers, and other identification numbers. It was developed by IBM scientist Hans Peter Luhn in 1954. Starting from the rightmost digit, every second digit is doubled. If the doubled value exceeds 9, subtract 9. Sum all the digits. If the total is divisible by 10, the number is valid. The algorithm detects single-digit transcription errors and most transposition errors, making it useful as a quick sanity check — though it is not a security measure.
- Does a valid Luhn result mean the card is real?
- No. A valid Luhn check only means the number passes the mathematical checksum — it does not mean the card account exists, is active, or has funds. Any sufficiently crafted 16-digit number with the right checksum will pass Luhn validation. Real card authorization requires network communication with the card issuer. This tool is useful for testing payment flows with realistic-looking test numbers, not for verifying real card accounts.
- What test card numbers can I use for payment testing?
- Major payment processors publish official test card numbers for sandbox environments. Common ones include: Visa 4111111111111111, Mastercard 5500000000000004, Amex 371449635398431, Discover 6011111111111117. These all pass Luhn validation. For Stripe, Adyen, Braintree, and others, check their respective developer documentation for the full list of test numbers that trigger specific responses (decline, insufficient funds, etc.).