ShotMark
Skip to Content

Credit Card Validator

Validate credit card numbers using the Luhn algorithm.

Waiting for input

What is Credit Card Validator?

A credit card validator is a developer tool that takes a card number, runs it through the Luhn checksum algorithm, and reports whether the number is structurally valid plus which card brand it belongs to. The validator only checks the mathematical structure of the number, not whether the card is real, active, or has funds.

This credit card validator processes the input client-side using the Luhn algorithm defined in ISO/IEC 7812, and the brand is detected from the leading digits (the Issuer Identification Number, or BIN). Frontend developers, QA engineers, and payment-integration teams use it to confirm test card numbers parse correctly and to spot transcription errors before submitting a form.

Privacy notice: All validation happens locally in your browser. Card numbers are never transmitted to a server, never written to storage, and never logged. Closing the tab clears the state. Even so, prefer the published test card numbers from your payment provider over real card data when testing.

Why use a Credit Card Validator?

  • Catch transcription typos. A single mistyped digit fails Luhn immediately, so you find the bug before submitting a checkout form that would otherwise return an opaque “card declined” error.
  • Confirm test card numbers are well-formed. Payment providers publish test numbers that pass Luhn. Validate them locally before pasting into your QA environment to rule out clipboard corruption.
  • Identify the card brand instantly. The validator detects Visa, Mastercard, American Express, Discover, JCB, Diners Club, and UnionPay from the BIN.
  • Stay private with sensitive data. Card numbers never leave your browser, so there is no server log, analytics event, or storage entry to worry about.

How to use the Credit Card Validator

  1. Paste your card number into the Card Number input. Spaces and hyphens are stripped automatically.
  2. The result panel updates as you type. A green check means the number passes Luhn; a red X means it does not.
  3. Read the brand label next to the result. The validator detects the brand from the leading digits and shows the detected name plus the digit count.
  4. To validate a different number, replace the contents of the input.

How Luhn validation works

The Luhn algorithm, also known as the modulus 10 check, is a checksum formula designed to catch single-digit errors and most adjacent-digit transpositions. Hans Peter Luhn patented it in 1960, and every modern payment card uses it.

1. Reverse the digits of the number. 2. Double every second digit (digits at index 1, 3, 5, ...). 3. If doubling produces a value > 9, subtract 9. 4. Sum all the resulting digits. If the total is divisible by 10, the number is valid.

Luhn catches all single-digit errors and most transpositions of two adjacent digits (it misses the rare 09 ↔ 90 swap). It does not verify the card exists or has funds.

Card brand detection table

The validator inspects the first 1 to 6 digits (the BIN range) and matches them against the published ranges for each brand. The number of digits in a valid number varies by brand.

BrandStarts withLengthExample
Visa413, 16, or 194111 1111 1111 1111
Mastercard5155, 22212720165555 5555 5555 4444
American Express34, 37153782 822463 10005
Discover6011, 65, 64464916 or 196011 1111 1111 1117
JCB3516 or 193530 1113 3330 0000
Diners Club300305, 36, 38143056 9300 0902 0004
UnionPay6216 to 196200 0000 0000 0005

When the leading digits do not match any known brand, the validator shows “Unknown card type” while still reporting the Luhn result.

Common use cases

  • Frontend developers building checkout forms. Validate that your form’s client-side check fires correctly for known test cards from Stripe or Adyen.
  • QA engineers writing payment regression tests. Confirm the test fixture cards are still Luhn-valid before running an end-to-end suite.
  • Support agents triaging declined payments. Rule out a customer typo before escalating to engineering.

Frequently asked questions

Are credit card numbers stored?

No. The number you paste stays in your browser tab’s memory while the page is open and is discarded when you close the tab. Nothing is sent over the network, written to storage, or captured by analytics.

Does passing Luhn mean the card is real?

No. Luhn only checks the mathematical structure. A number can pass Luhn and still be a fabricated test number, a closed account, or a card with insufficient funds.

Why does my Amex number show as 15 digits?

American Express cards have always been 15 digits long, not 16. The validator expects 15 digits for any card starting with 34 or 37.

Why is the brand reported as Unknown?

The leading digits do not match any of the BIN ranges in the table above. The number may be from a less common brand (Maestro, Verve, RuPay), a fabricated test number, or a typo in the first few digits.

Does the validator check the CVV or expiry date?

No. It only checks the card number with Luhn and detects the brand. CVV verification and expiry checks require a server call to the issuing bank.

Is it safe to test with real card numbers?

ShotMark does not store, log, or transmit the input, so the data does not leave your browser. Even so, use the published test numbers from your payment provider for development work.

Like this tool?

ShotMark captures what you do here, in one click.

The traces, payloads, and tests you run by hand? ShotMark grabs the whole bug and hands it to your AI agent.

Private beta accessFounding pricing lockNo spam ever