# Utf32 decode

`utf32-decode` · version 1.0.0 · Encoding & checksums · free, no key needed

Decode strict base64 UTF-32LE or UTF-32BE bytes after BOM, alignment, scalar, and noncharacter validation.

**Use when you need to: decode UTF-32 bytes · convert UTF-32LE to text · convert UTF-32BE to text.**

## Decide before calling

Read the [versioned contract](/v1/tools/utf32-decode/versions/1.0.0) and the supported scope below. Reuse `utf32-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 `utf32-decode@1.0.0` for decode UTF-32 bytes. 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

- decode UTF-32 bytes
- convert UTF-32LE to text
- convert UTF-32BE to text
- read BOM-marked UTF-32
- validate and decode UTF-32
- decode base64 UTF-32

## Not supported

- guess byte order without a BOM
- repair invalid Unicode scalar values

## Behavior

- Implements Unicode Standard 16.0, Unicode Encoding Schemes.
- Input bytes are canonical base64 and byte length is divisible by four.
- BOM policy and explicit endian must agree; auto requires a BOM.
- Surrogates and values above U+10FFFF are rejected; noncharacters follow the requested policy.
- Disclaimer: format transform only; provides no confidentiality, integrity, or authenticity.

## Input

- `base64` (string, required): min length 1; max length 5464
- `endian` (one of "le", "be", "auto", required)
- `bom_policy` (one of "allow", "require", "forbid", required)
- `noncharacters` (one of "allow", "reject", required)

## Output

- `text` (string, required): max length 1024
- `code_points` (integer, required): min 0; max 1024
- `endian` (one of "le", "be", required)
- `bom` (boolean, required)
- `standard_version` (constant "Unicode Standard 16.0, Unicode Encoding Schemes", required)

## Limits

- max input bytes: 4096
- max code points: 1024

## Example

Request input:

```json
{
  "base64": "QQAAAA==",
  "endian": "le",
  "bom_policy": "allow",
  "noncharacters": "allow"
}
```

Response:

```json
{
  "result": {
    "text": "A",
    "code_points": 1,
    "endian": "le",
    "bom": false,
    "standard_version": "Unicode Standard 16.0, Unicode Encoding Schemes"
  }
}
```

## How to call it

### MCP

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

```json
{
  "id": "utf32-decode",
  "version": "1.0.0",
  "input": {
    "base64": "QQAAAA==",
    "endian": "le",
    "bom_policy": "allow",
    "noncharacters": "allow"
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/utf32-decode/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"base64":"QQAAAA==","endian":"le","bom_policy":"allow","noncharacters":"allow"}'
```

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

### CLI

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

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

## Related tools

- [Utf32 encode](/tools/utf32-encode): Encode Unicode scalar text as bit-exact UTF-32LE or UTF-32BE base64 bytes with an optional BOM.
- [Utf32 BOM inspect](/tools/utf32-bom-inspect): Inspect base64 bytes for UTF-32 alignment and a UTF-32LE or UTF-32BE byte-order mark without guessing.
- [Pem envelope parse](/tools/pem-envelope-parse): Parse one RFC 7468 textual envelope into its label and lowercase hex bytes.
- [Asn1 oid parse](/tools/asn1-oid-parse): Parse an X.680 object identifier value into numeric arcs and dotted form.
- [Bech32 decode](/tools/bech32-decode): Decode Bech32 or Bech32m text into a lowercase HRP, 5-bit data, and the checksum variant.
- [Cid parse](/tools/cid-parse): Parse a CIDv0 or CIDv1 envelope without hashing content.
