# Base32 encoder and decoder

Encode text to Base32 (RFC 4648) or decode it back, with or without padding.

- Endpoint: `POST https://setget.net/v1/tools/base32` with JSON `{"input": {...}}`
- MCP: `run_tool` with `slug` = `base32`
- Page: https://setget.net/tools/base32

## Inputs

- `text` (required, string): The text to encode, or the Base32 to decode.
- `action` (optional, string, one of `encode`, `decode`, default `"encode"`): Encode text to Base32, or decode Base32 to text.
- `padding` (optional, boolean, default `true`): Keep the trailing "=" padding when encoding.

## Example 1

```json
{"input":{"text":"Hello"}}
```

Result:

```json
{"text":"JBSWY3DP","bytes":5}
```

## Example 2: Padding fills the last group

```json
{"input":{"text":"foobar"}}
```

Result:

```json
{"text":"MZXW6YTBOI======","bytes":6}
```

## Example 3: Lower case, spaces and no padding

```json
{"input":{"text":"mzxw 6ytb oi","action":"decode"}}
```

Result:

```json
{"text":"foobar","encoding":"utf-8","binary":false,"bytes":6}
```

**Which alphabet is used?** The standard RFC 4648 alphabet: A-Z and 2-7. Decoding ignores case, spaces and missing padding.

**What if the decoded data is not text?** Bytes that are not valid UTF-8 are returned as hex, with "binary" set to true.
