How to Check If a Credit Card Number Is Valid
Published: October 20, 2026 · By Marcus Hale, Payment Systems Analyst
Four checks determine whether a card number is structurally valid: prefix and length, Luhn checksum, security code format and expiry window.
1. Prefix and length
The first six digits identify the issuer, the brand, the card level and the country of issue, and they determine how many digits the number has in total. Start here: a number whose prefix is not in the open BIN dataset, or whose length does not match its brand, is not worth checking further.
2. Luhn checksum
The Luhn (mod 10) algorithm confirms the number is internally consistent. It catches single-digit errors and most transpositions. Use the Luhn Checker.
3. Security code format
Visa, Mastercard and Discover use a 3-digit CVV on the back. AMEX uses a 4-digit CID on the front. Use the CVV Validator.
4. Expiry window
A record must be inside its validity period. Check with the Expiry Checker.
Why four checks are better than one
Each check answers a different question. The prefix tells you what the number should look like. The Luhn check tells you the number is internally sound. The security code format and expiry window tell you the accompanying fields are plausible. Together they rule out the errors that actually occur when a number is typed, stored or transcribed by hand. No single check is sufficient on its own.
What validation cannot tell you
Structural validation cannot tell you whether an account exists, whether it is blocked, or whether the issuer would approve a transaction. Those questions require an authorisation request. Treat validation as a format verdict and never describe it as anything stronger.
A practical validation sequence
Confirm the prefix and expected length. Run the Luhn check. Validate the security code format and the expiry format. If all four pass, the record is well formed and carries no internal contradiction. Any conclusion beyond that needs a response from the issuer, which is a transaction and not a reference tool's job.