---
title: "Use this when you need to check whether a number passes the Luhn (mod-10) checksum used by credit cards and many identifier numbers, instead of computing the doubling-and-summing by hand."
method: POST
path: "/v1/luhn_validate"
tags: ["developer"]
---

# Use this when you need to check whether a number passes the Luhn (mod-10) checksum used by credit cards and many identifier numbers, instead of computing the doubling-and-summing by hand.

`POST /v1/luhn_validate`

## Request

- Base URL: `https://api.clean.tools`
- URL: `https://api.clean.tools/v1/luhn_validate`
- Auth: none declared

Use this when you need to check whether a number passes the Luhn (mod-10) checksum used by credit cards and many identifier numbers, instead of computing the doubling-and-summing by hand. Deterministic: same input, same output. Spaces and dashes are stripped first; any remaining non-digit character is an error. Returns the boolean result plus the full per-digit working, one steps entry per digit in original order (the digit, its transformed value after Luhn doubling, and whether that position was doubled). Example: {number:'4539 1488 0343 6467'} -> valid true, sum 80, mod10 0, digitCount 16.

## Request body

- object
  - `number` string, required: Digits to validate (spaces and dashes are ignored).

## Response `200`

Structured tool result.

- object
  - `tool` string
  - `result` object
    - `number` string, required: Input with spaces and dashes removed (digits only).
    - `valid` boolean, required: True when sum is divisible by 10 (mod10 === 0).
    - `sum` integer, required: Sum of the transformed digits.
    - `mod10` integer, required: sum modulo 10; 0 exactly when valid.
    - `digitCount` integer, required: Number of digits validated.
    - `steps` object[], required: Per-digit working, one entry per digit in original left-to-right order.
      - `digit` integer, required: The original digit (0-9).
      - `transformed` integer, required: Value used in the sum: doubled digits have 9 subtracted when the double exceeds 9, otherwise the digit is unchanged.
      - `doubled` boolean, required: Whether this position was doubled (every second digit from the right).

## Other responses

- `400`: Invalid input or the tool reported an error.
- `413`: Request body exceeds the 128 KB limit.
- `429`: Rate limit exceeded; the response carries Retry-After and RateLimit-* headers — honor them and add jitter.

---

[API](https://skmtc.dev/clean/apis/clean-tools-api.md) · [All operations](https://skmtc.dev/clean/apis/clean-tools-api/llms.txt) · [OpenAPI document](https://skmtc.dev/clean/apis/clean-tools-api/revisions/a24a01d2833c?raw)
