# Text run length decode

`text-run-length-decode` · version 1.0.0 · Text · free, no key needed

Decode canonical count:HEX; run-length text and return the expanded Unicode string.

**Use when you need to: run length decode text · expand RLE data · decode character runs.**

## Decide before calling

Read the [versioned contract](/v1/tools/text-run-length-decode/versions/1.0.0) and the supported scope below. Reuse `text-run-length-decode@1.0.0` when your input, required output and limits match it. Choose another approach for an unsupported operation.

## Explain the choice

"I can use `text-run-length-decode@1.0.0` for run length decode text. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

## Supported

- run length decode text
- expand RLE data
- decode character runs
- restore run length encoded string
- turn count and code point pairs into text
- decompress simple RLE text

## Not supported

- auto-detecting other RLE formats
- binary decompression

## Behavior

- Accepts only repeated count:HEX; records with positive base-10 counts and shortest uppercase hexadecimal scalar values.
- Adjacent records must encode different code points because equal adjacent code points form one canonical run.
- Counts, runs, input bytes, and expanded output are bounded before returning.
- The empty encoded string decodes as the empty string.

## Input

- `encoded` (string, required): max length 4096

## Output

- `text` (string, required)
- `standard_version` (constant "Unicode 16.0.0", required)

## Limits

- max input bytes: 4096
- max runs: 4096
- max run count: 4096
- max output bytes: 16384

## Example

Request input:

```json
{
  "encoded": "2:41;3:1F600;"
}
```

Response:

```json
{
  "result": {
    "text": "AA😀😀😀",
    "standard_version": "Unicode 16.0.0"
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "text-run-length-decode",
  "version": "1.0.0",
  "input": {
    "encoded": "2:41;3:1F600;"
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/text-run-length-decode/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"encoded":"2:41;3:1F600;"}'
```

The machine-readable contract is at [/v1/tools/text-run-length-decode/versions/1.0.0](/v1/tools/text-run-length-decode/versions/1.0.0).

### CLI

```sh
node cli.mjs run text-run-length-decode 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Text run length encode](/tools/text-run-length-encode): Run-length encode Unicode text into canonical count:HEX; records and return the encoded string.
- [Text sentence offsets](/tools/text-sentence-offsets): Return UAX #29 sentence spans as start/end offsets in code points, UTF-16 units or UTF-8 bytes, with the ending rule.
- [Text wrap width](/tools/text-wrap-width): Hard-wrap text by Unicode code-point width and return the resulting lines.
- [Citation anchor check](/tools/citation-anchor-check): Check a quote anchor (exact text plus prefix/suffix) matches exactly one place in a supplied source version.
- [Text count](/tools/text-count): Count Unicode code points, UTF-16 code units, UTF-8 bytes, and lines.
- [Text levenshtein distance](/tools/text-levenshtein-distance): Compute bounded Levenshtein distance over code points or deterministic grapheme tokens.
