Skip to content
PithLab

↑↓ to move · Enter to open · Esc to close

Credit Card Validator API

Check a payment card number's format: brand from its IIN prefix, length and Luhn check digit. Does not contact any bank or check whether the card exists.

POST /api/v1/tools/credit-card-validatorMCP credit_card_validatorSecurity & Privacy

Check a card number with the Luhn algorithm, detect Visa, Mastercard, Amex and other brands, check the length and format it. Bulk mode included, all offline.

Input

Send these as a JSON object. Unknown fields are rejected.

number
The card number; spaces and dashes are ignored. Use test numbers such as 4111 1111 1111 1111, never real cards. (string, up to 40 characters, required)
curl https://pithlab.com/api/v1/tools/credit-card-validator \n  -H "Authorization: Bearer $PITHLAB_KEY" \n  -H "Content-Type: application/json" \n  -d '{"number":"4111 1111 1111 1111"}'
Example response
{
  "ok": true,
  "result": {
    "valid": true,
    "brand": "Visa",
    "luhn": true,
    "lengthOk": true,
    "digits": 16,
    "formatted": "4111 1111 1111 1111",
    "messages": []
  }
}