# Text to binary converter

Convert text to binary, octal or decimal byte values and back again.

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

## Inputs

- `text` (required, string): The text to convert, or the byte values to turn back into text.
- `action` (optional, string, one of `encode`, `decode`, default `"encode"`): Encode text to numbers, or decode numbers to text.
- `base` (optional, string, one of `binary`, `octal`, `decimal`, default `"binary"`): How each byte is written: binary (8 digits), octal (3 digits) or decimal.

## Example 1

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

Result:

```json
{"text":"01001000 01101001","bytes":2}
```

## Example 2: Decimal byte values (ASCII codes)

```json
{"input":{"text":"Hi","base":"decimal"}}
```

Result:

```json
{"text":"72 105","bytes":2}
```

## Example 3: Binary without spaces

```json
{"input":{"text":"0100100001101001","action":"decode"}}
```

Result:

```json
{"text":"Hi","encoding":"utf-8","binary":false,"bytes":2}
```

## Example 4

```json
{"input":{"text":"110 151","action":"decode","base":"octal"}}
```

Result:

```json
{"text":"Hi","encoding":"utf-8","binary":false,"bytes":2}
```

**Why does one character give several numbers?** Text is stored as UTF-8 bytes. Plain English letters take one byte each, while accented letters, other scripts and emoji take two to four.

**How should the numbers be separated for decoding?** With spaces, commas or line breaks. Binary in full groups of 8 digits and octal in groups of 3 can also be run together.
