Credit Card Validator API - Luhn Check & Brand Detection
Send a credit card number and get back whether it passes the Luhn checksum, which card network issued it (Visa, Mastercard, Amex, Discover, JCB, Diners Club, UnionPay), and whether it is a credit or debit card. The number is validated server-side and never stored or logged.
Run a quick Luhn check on the card number before sending it to your payment processor. This catches typos and fake numbers before they hit Stripe or Adyen, reducing declined transaction fees.
Show the correct card brand icon in your payment form
Detect whether the user entered a Visa, Mastercard, or Amex number as they type and display the matching logo. Reduces user confusion and builds trust during checkout.
Flag suspicious card numbers in fraud review queues
Batch-validate card numbers stored in your risk system. Cards that fail the Luhn check are guaranteed invalid; auto-flag them so analysts focus on the ambiguous cases.
Frequently asked questions
Does this API store or log the card numbers I send?
No. The card number is validated in memory on the server and discarded immediately after the response is sent. Nothing is written to disk or any database.
Can this API verify that a card is active and has funds?
No. This endpoint performs a Luhn checksum and brand detection only. It confirms the number is structurally valid, not that the card is active or funded. For live verification, you need a payment processor like Stripe.
What card brands are supported?
Visa, Mastercard, American Express, Discover, JCB, Diners Club, and UnionPay. If the number passes the Luhn check but does not match a known BIN range, the brand field returns "Unknown".
Does the number need to be formatted in a specific way?
No. Spaces, dashes, and dots are stripped automatically before validation. You can send "4111 1111 1111 1111" or "4111-1111-1111-1111" and both work.
Is the Luhn algorithm enough to prevent fraud?
The Luhn check filters out random and mistyped numbers. It is a first layer of validation, not a fraud prevention tool. Pair it with your payment processor's built-in fraud detection for full coverage.
Get your API key
Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.