Transform - Encoding

Free Hex Decode API Endpoint

The free hex decode API endpoint turns hexadecimal back into the bytes it stands for. Either case works, and so do a leading 0x and spaces. One Accept header decides whether you get text, a typed JSON envelope or the raw bytes.

  • No API key
  • Either case
  • Text, JSON or bytes
  • One POST request

Decode hex

POST/hex_decode

https://aisenseapi.com/services/v1/hex_decode

Call the free hex decode API endpoint

Post the hex under a data key and ask for text:

curl -X POST https://aisenseapi.com/services/v1/hex_decode \
  -H "Content-Type: application/json" \
  -H "Accept: text/plain" \
  -d '{"data": "68656C6C6F"}'
hello

The other way is the hex encode API endpoint.

Three response shapes, one Accept header

Decoded bytes can be text, JSON or anything else, so the endpoint answers exactly as the Base64 decode API endpoint does, chosen by the Accept header:

Accept header sentResponse
text/plaintext/plain; charset=utf-8, the decoded text as the whole body
application/json{"type": "json", "decoded_data": ...} when the bytes are JSON, otherwise {"type": "binary", "encoding": "base64", "decoded_data": "..."}
application/octet-stream, the wildcard or no headerapplication/octet-stream, an attachment named decoded_data.bin
anything elseHTTP 406 with a fix
curl -X POST https://aisenseapi.com/services/v1/hex_decode \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{"data": "7b226f6b223a747275657d"}'
{"type":"json","decoded_data":{"ok":true}}

Sending the input

The digits 0-9 and a-f, in either case. A leading 0x and spaces, tabs and line breaks between the digits are allowed, so a hex dump can be pasted as it is. The count of digits has to be even, two for every byte.

Send the data as {"data": "..."} with Content-Type: application/json, or as the raw request body with any other content type. The raw body takes binary data as it is: curl --data-binary @file.bin -H "Content-Type: application/octet-stream".

Errors

StatuserrorWhen
400No data to decode.No data string and no body
400Invalid hex input.An odd count of digits, or a character that is not hex
406Unsupported Accept header.An Accept header the endpoint cannot answer
413Data over 1 MiB.More than 1 MiB in one request

Each refusal also carries fix, a sentence saying what to send instead.

Common uses

Read a hex dump

Turn the hex a log, a debugger or a packet capture shows back into the text or file it was.

Digests and keys as bytes

Get the raw bytes of a key or a digest written in hex, to hand on to something that wants bytes.

Device payloads

Many sensors and radio networks deliver their readings as hex; decode them before parsing.

Privacy and limits

Nothing is stored. The hex decode answer is worked out while the request is open and the data is gone with it. The access log records the path and the status, not the body.

The base URL is https://aisenseapi.com/services/v1. There is no key, no account and no sign-up step. One request carries at most 1 MiB of data, and the service-wide limit is 5000 requests per IP address per day. Every endpoint in the collection is listed on the Free public REST APIs reference, and the encodings side by side on Encoding APIs.