Hex encoder and decoder
Convert text to hexadecimal bytes and back, with optional upper case and separators.
Input
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/hex \
-H 'Content-Type: application/json' \
-d '{"input":{"text":"Hello"}}'
import json, urllib.request
body = {'input': {'text': 'Hello'}}
request = urllib.request.Request("https://setget.net/v1/tools/hex", 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/hex", {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify({"input":{"text":"Hello"}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
"slug": "hex",
"input": {
"text": "Hello"
}
}
{
"input": {
"text": "Hello"
}
}
Endpoint: POST /v1/tools/hex. Over MCP: run_tool with slug: "hex".
Machine-readable: input schema, Markdown. Connect an agent.
Inputs
| Name | Type | Required | What it does |
|---|---|---|---|
text |
string | yes | The text to encode, or the hex to decode. |
action |
string | no | Encode text to hex, or decode hex to text. One of: encode, decode. Default: "encode". |
uppercase |
boolean | no | Write the hex digits A-F in upper case when encoding. Default: false. |
separator |
string | no | What to put between bytes when encoding. One of: none, space, colon. Default: "none". |
Examples
Input
{
"text": "Hello"
}Result
{
"text": "48656c6c6f",
"bytes": 5
}Upper case with colons
Input
{
"text": "Hi!",
"uppercase": true,
"separator": "colon"
}Result
{
"text": "48:69:21",
"bytes": 3
}Decoding ignores prefixes and separators
Input
{
"text": "0x48 0x65 6c:6c:6f",
"action": "decode"
}Result
{
"text": "Hello",
"bytes": 5
}Questions
- Which separators can I decode?
- Spaces, line breaks, colons, commas, hyphens and "0x" prefixes are all ignored when decoding.
- Why does decoding fail with "not UTF-8"?
- The bytes are binary data, not text. Hex is already the clearest way to show them.
Related tools
- Base64 encoder and decoderEncode text to Base64 or decode it back, in the standard or URL-safe alphabet.
base64 - Text to binary converterConvert text to binary, octal or decimal byte values and back again.
binary-text - String bytes and code pointsShow the UTF-8, UTF-16 and UTF-32 bytes and the Unicode code points of a text.
string-escape-bytes - Hash generatorCompute an MD5, SHA-1, SHA-256, SHA-384, SHA-512, SHA3-256 or BLAKE2b hash of text or bytes.
hash - All hashes at onceCompute every supported hash of one input at once: MD5, SHA-1, SHA-2, SHA3-256 and BLAKE2b.
hash-all - Base32 encoder and decoderEncode text to Base32 (RFC 4648) or decode it back, with or without padding.
base32