Text to Hex & Hex to Text · Tutorial
How to decode hex bytes from a log or debugger
4 min readbeginnerUpdated
A log line, debugger or packet capture shows a payload as hex bytes, like \x7b\x22\x73…, and you need to know what it says. This tutorial decodes it in one step and explains how to handle the different notations and multi-byte characters you'll come across.
What you need
- The Text to Hex & Hex to Text converter
- The hex bytes from your log or tool (the Try it button loads an escaped payload)
Steps
Copy the hex
Copy the byte sequence from your log or debugger. You don't need to remove
\x,%,0xor spaces. The sample is a Python-style escaped byte string.\x7b\x22\x73\x74\x61\x74\x75\x73\x22\x3a\x22\x6f\x6b\x22\x7dPaste and read the result
Paste it into the left box. The text appears on the right. The sample decodes to
{"status":"ok"}, a small JSON response.Check multi-byte characters
Open Character details to see how bytes map to characters. Plain ASCII is one byte per character. If your payload contains accented letters or emoji, you'll see them built from two to four bytes each.
Continue with the decoded text
If the result is JSON, paste it into the JSON Formatter to read it comfortably. If it's Base64 text, decode it again with Base64 Decode.
Try it yourself
Opens the Text to Hex & Hex to Text with this tutorial's sample loaded.
Common mistakes
- Missing a digit
- If the message says the hex doesn't divide into whole bytes, a digit was lost when copying. Copy the sequence again.
- Decoding binary data as text
- Images, compressed data and encrypted bytes aren't text, so they produce a warning and � characters. That's expected. Those bytes need a different tool.
- Mixing notations within one byte
- Each byte must be two hex digits. Values like
\x7(one digit) aren't valid byte escapes in this context.
Next steps
Go back to the Text to Hex & Hex to Text, or keep going with one of these:
FAQ
What if my log shows decimal numbers instead of hex?
Use Text to Binary with Decimal selected.