# Base58 encoder and decoder

Encode text or bytes to Base58 with the Bitcoin alphabet, or decode Base58 back.

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

## Inputs

- `text` (required, string): The value to encode, or the Base58 to decode.
- `action` (optional, string, one of `encode`, `decode`, default `"encode"`): Encode to Base58, or decode Base58.
- `input_encoding` (optional, string, one of `text`, `hex`, `base64`, default `"text"`): When encoding, how the input is written: plain text (UTF-8), hex digits or base64.

## Example 1

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

Result:

```json
{"text":"2NEpo7TZRRrLZSi2U","bytes":12}
```

## Example 2: Leading zero bytes become leading 1s

```json
{"input":{"text":"0000287fb4cd","input_encoding":"hex"}}
```

Result:

```json
{"text":"11233QC4","bytes":6}
```

## Example 3

```json
{"input":{"text":"2NEpo7TZRRrLZSi2U","action":"decode"}}
```

Result:

```json
{"text":"Hello World!","encoding":"utf-8","binary":false,"bytes":12}
```

**Is this Base58Check?** No. This is plain Base58. Base58Check, used for Bitcoin addresses, also appends a four-byte checksum, which is not added or verified here.

**Why are 0, O, I and l missing?** The Bitcoin alphabet leaves them out because they look alike when read or typed.

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