# Base64url decode

`base64url-decode` · version 1.0.0 · Other utilities · free, no key needed

Decode base64url to UTF-8 text or lowercase hex and return the requested value.

**Use when you need to: decode URL-safe base64 · base64url to UTF-8 text · base64url to hex bytes.**

## Decide before calling

Read the [versioned contract](/v1/tools/base64url-decode/versions/1.0.0) and the supported scope below. Reuse `base64url-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 `base64url-decode@1.0.0` for decode URL-safe base64. 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 URL-safe base64
- base64url to UTF-8 text
- base64url to hex bytes
- read an unpadded base64 URL value
- decode padded URL-safe base64
- turn JWT-style base64 bytes into text

## Not supported

- verify a JWT signature
- accept standard base64 plus or slash
- guess whether binary bytes are text

## Behavior

- The padding policy is required: required, forbidden, or optional.
- output text requires strictly valid UTF-8; output hex always returns lowercase byte pairs.
- Rejects non-canonical encodings whose unused pad bits are non-zero.
- Disclaimer: format transform only; provides no confidentiality, integrity, or authenticity.

## Input

- `encoded` (string, required): max length 16384
- `padding` (one of "required", "forbidden", "optional", required)
- `output` (one of "text", "hex", required)

## Output

- `value` (string, required): max length 24576
- `encoding` (one of "text", "hex", required)
- `standard_version` (constant "RFC 4648 §5 (2006); RFC 7515 Appendix C (2015)", required)

## Limits

- max input bytes: 16384
- max output bytes: 24576

## Example

Request input:

```json
{
  "encoded": "SGVsbG8_",
  "padding": "forbidden",
  "output": "text"
}
```

Response:

```json
{
  "result": {
    "value": "Hello?",
    "encoding": "text",
    "standard_version": "RFC 4648 §5 (2006); RFC 7515 Appendix C (2015)"
  }
}
```

## How to call it

### MCP

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

```json
{
  "id": "base64url-decode",
  "version": "1.0.0",
  "input": {
    "encoded": "SGVsbG8_",
    "padding": "forbidden",
    "output": "text"
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/base64url-decode/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"encoded":"SGVsbG8_","padding":"forbidden","output":"text"}'
```

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

### CLI

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

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

## Related tools

- [Base64url encode](/tools/base64url-encode): Encode supplied UTF-8 text or hexadecimal bytes as base64url and return the encoded string.
- [Html to plain text](/tools/html-to-plain-text): Strip HTML and script/style text, decode supported references; collapse whitespace including inside pre elements.
- [Base64url validate](/tools/base64url-validate): Check canonical base64url syntax and return validity plus the first invalid character when present.
- [Rtf to markdown](/tools/rtf-to-markdown): Convert an 8 KiB ANSI-1252 RTF text subset to escaped Markdown; unsupported Word features are refused.
- [Bytes parse human](/tools/bytes-parse-human): Parse an SI or IEC byte-size string and return an exact integer byte count using explicit rounding.
- [Identifier case convert](/tools/identifier-case-convert): Convert an ASCII identifier to a requested common case and return the converted identifier.
