Credit Card Number Validator

Validate credit card numbers using the Luhn algorithm (mod 10 checksum). Detects card network (Visa, Mastercard, Amex, Discover, JCB, Diners Club, UnionPay) and checks format validity. For testing and development only. 100% browser-based.

100% FreeZero Server ProcessingDev/QA Tool
Nothing is Stored or Transmitted

Validation runs entirely in your browser using JavaScript. No card numbers are sent to any server, logged, or stored. The number is cleared from memory after validation. We recommend using test numbers only (e.g., Stripe test: 4242424242424242).

Quick Test Numbers (click to autofill):

Key Facts

  • Algorithm: Luhn (modulus 10 checksum) — ISO/IEC 7812-1 standard, created by Hans Peter Luhn at IBM in 1954
  • Purpose: Detects accidental errors like single-digit typos and adjacent digit transpositions. Does NOT verify if a card exists or has funds
  • Card Detection: Identifies Visa, Mastercard, American Express, Discover, JCB, Diners Club, and UnionPay from IIN (Issuer Identification Number) prefix ranges
  • Privacy: Validation runs in browser JavaScript. Zero network requests. Number cleared from memory after validation
  • Use Case: Designed for developers, QA testers, and e-commerce teams validating payment form logic. Not for verifying stolen cards

Card Network Identification Prefixes (IIN Ranges)

  • Visa: Starts with 4. Length: 13 or 16 digits. Most widely accepted card worldwide
  • Mastercard: Starts with 51-55 or 2221-2720. Length: 16 digits. Second largest network globally
  • American Express: Starts with 34 or 37. Length: 15 digits. Known for premium cards and higher interchange fees
  • Discover: Starts with 6011, 644-649, or 65. Length: 16 digits. Popular in the US, accepted in 200+ countries
  • JCB: Starts with 3528-3589. Length: 16 digits. Major network in Japan and Asia
  • Diners Club: Starts with 36, 38, or 300-305. Length: 14 digits. Used primarily for travel and entertainment
  • UnionPay: Starts with 62. Length: 16-19 digits. Largest card network by transaction volume (China)

How the Luhn Algorithm Works

  • Step 1: Starting from the rightmost digit (check digit), double every second digit moving left
  • Step 2: If doubling produces a number greater than 9, subtract 9 (e.g., 8 × 2 = 16 → 16 - 9 = 7)
  • Step 3: Sum all digits (both doubled and undoubled)
  • Step 4: If the total modulo 10 equals 0, the number is valid
  • Catches: Detects all single-digit errors and most adjacent transposition errors (except 09 ↔ 90)
  • Limitations: Does not detect all transposition errors, cannot verify card existence, balance, or authorization status

Frequently Asked Questions

What is the Luhn algorithm?

The Luhn algorithm (also called modulus 10 or mod 10) is a checksum formula used to validate identification numbers including credit card numbers, IMEI numbers, and national ID numbers. It detects accidental errors like single-digit mistakes and adjacent digit transpositions. Created by Hans Peter Luhn at IBM in 1954, it is now standardized as ISO/IEC 7812-1.

Does this tool verify if a card has funds or is active?

No. This tool only checks if the card number's format is mathematically valid using the Luhn checksum, and identifies the card network from the prefix (IIN). It cannot verify whether the card exists, has funds, is expired, or is active. Only a payment processor connected to the card network can do that.

Is it safe to enter my card number here?

The validation runs entirely in your browser and nothing is transmitted. However, we strongly recommend using test card numbers only. Standard test numbers include Visa 4242424242424242, Mastercard 5555555555554444, and Amex 378282246310005 (these are Stripe test numbers and not real cards).

Why would a developer need this tool?

Developers building e-commerce checkout forms use Luhn validation for client-side input checking before sending to the payment processor. QA testers verify that payment forms accept valid test numbers and reject invalid ones. This tool helps test that logic without needing a live payment gateway.

Can the Luhn algorithm detect all errors?

No. Luhn detects all single-digit substitution errors and most adjacent transposition errors, but it cannot detect the transposition of 09 and 90. It also cannot detect more complex permutation errors. It is a quick first-pass check, not a complete validation.