Text to binary converter

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

Input

The text to convert, or the byte values to turn back into text.
Encode text to numbers, or decode numbers to text.
How each byte is written: binary (8 digits), octal (3 digits) or decimal.

Result

Fill in the input and press Run.

Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.

Use it from code or an agent

curl -s https://setget.net/v1/tools/binary-text \
  -H 'Content-Type: application/json' \
  -d '{"input":{"text":"Hi"}}'
import json, urllib.request

body = {'input': {'text': 'Hi'}}
request = urllib.request.Request("https://setget.net/v1/tools/binary-text", json.dumps(body).encode(),
                                 {"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/binary-text", {
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({"input":{"text":"Hi"}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
  "slug": "binary-text",
  "input": {
    "text": "Hi"
  }
}
{
  "input": {
    "text": "Hi"
  }
}

Endpoint: POST /v1/tools/binary-text. Over MCP: run_tool with slug: "binary-text". Machine-readable: input schema, Markdown. Connect an agent.

Inputs

NameTypeRequiredWhat it does
text string yes The text to convert, or the byte values to turn back into text.
action string no Encode text to numbers, or decode numbers to text. One of: encode, decode. Default: "encode".
base string no How each byte is written: binary (8 digits), octal (3 digits) or decimal. One of: binary, octal, decimal. Default: "binary".

Examples

Input
{
  "text": "Hi"
}
Result
{
  "text": "01001000 01101001",
  "bytes": 2
}

Decimal byte values (ASCII codes)

Input
{
  "text": "Hi",
  "base": "decimal"
}
Result
{
  "text": "72 105",
  "bytes": 2
}

Binary without spaces

Input
{
  "text": "0100100001101001",
  "action": "decode"
}
Result
{
  "text": "Hi",
  "encoding": "utf-8",
  "binary": false,
  "bytes": 2
}
Input
{
  "text": "110 151",
  "action": "decode",
  "base": "octal"
}
Result
{
  "text": "Hi",
  "encoding": "utf-8",
  "binary": false,
  "bytes": 2
}

Questions

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.