Credit Card Validator

Luhn checksum + issuing network detection

Card number

⚠️ For validation/format testing only. Do not enter a real card number. No input leaves your browser — but treat any card number as sensitive.

About

Check whether a credit card number passes the Luhn checksum and identify the issuing network from its prefix and length. The check runs entirely in your browser — the number is never sent anywhere. Useful for validating form input or learning how card numbers are structured.

    Examples

    Validate a Visa number

    Input
    4111 1111 1111 1111
    Output
    ✓ Valid Visa
    Length: 16
    Luhn: passes
    Issuer: Visa (IIN 4xxxxx)

    Strips spaces, runs the Luhn algorithm, and reports the issuer from the IIN prefix.

    Detect an American Express number

    Input
    3782 822463 10005
    Output
    ✓ Valid Amex
    Length: 15
    Luhn: passes
    Issuer: American Express (IIN 37xxx)

    Recognizes the 34/37 IIN prefix and the 15-digit length band that distinguishes Amex from Visa and Mastercard.

    About this tool

    The Credit Card Validator checks whether a card number is structurally valid and identifies the issuing network. It strips spaces and dashes, runs the Luhn checksum, and matches the IIN/BIN prefix against the major networks — Visa, Mastercard, American Express, Discover, JCB, Diners Club, Maestro and UnionPay.

    Validation is purely local: the number is never transmitted, so it is safe to inspect production card data or QA test cards without leaving a trace. Luhn-validity confirms the format, not that the account is real — only the payment processor can confirm that.

    How to use

    1. Paste a card number

      Enter the number with or without spaces and dashes; both are accepted and stripped before validation.

    2. Read the result

      The tool reports whether the number passes the Luhn check, the detected network, and the expected length band for that network.

    3. Use it to catch typos

      Run a customer-entered number through the validator before submitting it, so a transposed digit fails immediately instead of triggering a decline at the gateway.

    Use cases

    Catching typos in payment forms

    Validate a card number client-side before submitting, so a transposed digit fails immediately instead of triggering a declined transaction at the gateway.

    Identifying the issuer on the back-end

    Return the card network (Visa, Mastercard, Amex, …) from the BIN so your checkout can route to the right processor or apply network-specific rules.

    QA for test cards

    Sanity-check that test card numbers in your QA suite are still Luhn-valid after a copy-paste or schema change.

    Common mistakes

    Mistake:Believing a valid card number means the card is real.

    Fix:Luhn and IIN confirm the format and the issuer, not that the account exists or has funds. Only the payment processor can confirm that.

    Mistake:Logging the raw card number for debugging.

    Fix:Luhn-valid numbers are still payment card data. Mask them (e.g. keep only the last four digits) and never log them in plaintext, even temporarily.

    Mistake:Assuming a single regex covers every network.

    Fix:Each issuer has its own IIN prefix and length band. Use a dedicated validator, not a regex, so 15-digit Amex and 16-digit Visa are both recognised correctly.

    Frequently asked questions

    References & standards