---
title: "Use this when you need the exact SHA-1, SHA-256, and/or SHA-512 hex digest of a UTF-8 string — never recall or guess a hash, since digests cannot be produced from memory."
method: POST
path: "/v1/hash_text"
tags: ["developer"]
---

# Use this when you need the exact SHA-1, SHA-256, and/or SHA-512 hex digest of a UTF-8 string — never recall or guess a hash, since digests cannot be produced from memory.

`POST /v1/hash_text`

## Request

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

Use this when you need the exact SHA-1, SHA-256, and/or SHA-512 hex digest of a UTF-8 string — never recall or guess a hash, since digests cannot be produced from memory. Deterministic: same input, same output. Pass `algorithm` for a single digest or `algorithms` for a subset; the default computes all three. The empty string is valid, and `byteLength` reports the UTF-8 encoded byte length of the input. Example: text "hello" with algorithm SHA-256 -> byteLength 5, hashes["SHA-256"] = "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824".

## Request body

- object
  - `text` string, required: The text to hash (UTF-8; empty string is allowed).
  - `algorithm` 'SHA-1' | 'SHA-256' | 'SHA-512': A single algorithm to compute.
  - `algorithms` string[]: Multiple algorithms (default: all three).

## Response `200`

Structured tool result.

- object
  - `tool` string
  - `result` object
    - `byteLength` integer, required: UTF-8 encoded byte length of the input text (0 for the empty string).
    - `hashes` object, required: Lowercase hex digest keyed by algorithm; only the requested algorithms appear.
      - `SHA-1` string: 40-char lowercase hex SHA-1 digest.
      - `SHA-256` string: 64-char lowercase hex SHA-256 digest.
      - `SHA-512` string: 128-char lowercase hex SHA-512 digest.

## 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)
