Snipget.ai

Identifiers validate luhn

Exact
identifiers_validate_luhn

Deterministic and authoritative — the canonical answer for this input.

Validate any digit string with the Luhn mod-10 algorithm. Works for credit card numbers, IMEI codes, and any Luhn-protected identifier. Spaces and dashes are stripped before checking. Returns is_valid, normalized digit-only form, and digit length. Processing multiple inputs? Use `identifiers_validate_luhn_batch` to do up to 1000 in one call.

Parameters

valuestringrequired

The identifier string to validate.

Call it

curl -X POST https://api.snipget.ai/v1/identifiers/validate/luhn \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"value":"4532015112830366"}'

The Batch tab sends up to 1000 inputs in one call via /v1/identifiers/validate/luhn/batch.

Example response

{
  "input": "4532015112830366",
  "is_valid": true,
  "normalized": "4532015112830366",
  "length": 16
}

FAQ

What is the Luhn check good for?

It catches typos in numbers that carry a built-in check digit, such as credit card numbers and IMEI codes. If someone fat-fingers a digit, the Luhn check usually flags it.

Does a pass mean the card is real or active?

No. Luhn only confirms the digits are internally consistent. It does not mean the card exists, has funds, or is unexpired. It is a typo catcher, not a payment check.

Can I include spaces or dashes?

Spaces and dashes are stripped before checking, so card numbers in their usual spaced or dashed form work fine. Any other character fails validation instead of being silently dropped — a corrupted ID should fail, not pass.

How reliable is the verdict?

It is exact and deterministic: the same number always gives the same result. Note Luhn cannot catch every error, for example some digit swaps still pass, which is a property of the algorithm itself.

Related tools