← All tools
Free tool · runs in your browser

Credit card validator

Check a card number's Luhn checksum and detect its network. Runs locally — nothing is sent anywhere. Use a test number like 4242 4242 4242 4242 to try it.

What this tool checks

It runs the Luhn checksum (the algorithm every card number must satisfy) and detects the card network from the number prefix and length — Visa, Mastercard, Amex, Discover, JCB, Diners and more. It does NOT check whether the card exists, has funds, or is active; only a payment processor can do that.

The Luhn algorithm

The Luhn (mod-10) algorithm is a simple checksum: double every second digit from the right, sum the digits, and a valid number's total is divisible by 10. It catches most single-digit typos and adjacent transpositions, which is why nearly all card numbers use it.

Card networks detected

  • Visa — starts with 4, length 13/16/19.
  • Mastercard — 51–55 or 2221–2720, length 16.
  • American Express — 34 or 37, length 15.
  • Discover, JCB, Diners Club, UnionPay and Maestro.

Validate cards via API

Doing this at signup or checkout? Keep card logic off the client — call the Oxide Data Validator /v1/validate/card endpoint for Luhn + network detection at the edge.

curl -X POST https://data-validator5.p.rapidapi.com/v1/validate/card \
  -H "Content-Type: application/json" \
  -H "X-RapidAPI-Key: YOUR_KEY" \
  -H "X-RapidAPI-Host: data-validator5.p.rapidapi.com" \
  -d '{"number":"4242424242424242"}'

FAQ

What does this credit-card validator check?

It runs the Luhn checksum (the algorithm every card number must satisfy) and detects the card network from the number prefix and length — Visa, Mastercard, Amex, Discover, JCB, Diners and more. It does NOT check whether the card exists, has funds, or is active; only a payment processor can do that.

Is it safe to type a card number here?

The check runs entirely in your browser — nothing is sent anywhere or logged. That said, never paste a real card number into any website you don't fully trust. Use a test number (e.g. 4242 4242 4242 4242) when you just want to see the validator work.

What is the Luhn algorithm?

The Luhn (mod-10) algorithm is a simple checksum: double every second digit from the right, sum the digits, and a valid number's total is divisible by 10. It catches most single-digit typos and adjacent transpositions, which is why nearly all card numbers use it.

Can a number pass Luhn but still be fake?

Yes. Luhn only proves the number is well-formed, not that it maps to a real, active account. Test card numbers pass Luhn by design. Real authorization requires a payment processor.

Can I validate cards from an API?

Yes. The Oxide Data Validator /v1/validate/card endpoint runs Luhn plus network detection server-side, so you can validate at signup or checkout without shipping card logic to the client.