xtract.bot
POST /api/hex-encode

Encode bytes as hex (lowercase, uppercase, with optional `0x` prefix or `:` separators). The classic format for inspecting bytes.

Encodes any bytes as a hex string. Options: - `uppercase` (default false): emit `ABCDEF` rather than `abcdef`. - `prefix` (default false): prepend `0x` — common in low-level programming and protocol traces. - `separator`: a string to insert between every byte. Pass `:` for MAC-address-style output, ` ` for space-separated.

Inputs

NameTypeDefaultDescription
data*fileBytes to encode (base64-encoded by the playground).
caseenum (lower | upper)"lower"Case of the hex digits a-f.
separatorstring""Optional separator inserted between every byte.
prefixbooleanfalsePrepend '0x' to the result.

Response

Modes: json, text. Cache: yes (24h TTL).

Code samples

Built from the hello-lower example.

# Download or substitute the example input:
#   curl -O https://xtract.bot/examples/hex-encode/hello.txt
DATA=$(base64 -w0 < hello.txt)

curl -X POST https://api.xtract.bot/api/hex-encode \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
  -H "X-Api-Key: $XTRACT_API_KEY" \
  -d '{
  "case": "lower",
  "separator": "",
  "prefix": false,
  "data": "'"$DATA"'"
}'