toolbench.onlineby Valkyron Labs

Encode / Decode

Hex Encode / Decode

Turn text into space-separated hexadecimal bytes, or turn those bytes back into text. Hex is lowercase UTF-8. A token that is not hex is rejected.

Hex Encode / Decode

Encode text to space-separated hex bytes, or decode those bytes back to text.

Ready to run.

Hex output

—

Output actions

Ready to copy output once your result appears.

Spaced UTF-8 hex bytes

Hex Encode / Decode turns text into lowercase hexadecimal bytes separated by spaces, or turns those bytes back into text. Encode uses UTF-8. Decode expects whitespace between bytes. A single run of hex digits is one token, not a stream of pairs. An empty encode succeeds. An empty decode is rejected.

How to encode or decode hex

  1. 1Choose Encode or Decode. Encode is selected at open. The field label is Text to encode, or Hex bytes to decode (space-separated) after you switch.
  2. 2Paste the text or the bytes. The Encode placeholder is Hello, World! The Decode placeholder is the spaced hex of that sentence. Switching mode does not run the conversion.
  3. 3Press Run, then Copy output. Encode of an empty box succeeds with an empty result and says Encoded to hex successfully. Decode of an empty box says Invalid hex input. and clears the result. There is no download.

What it is good for

  • • Seeing Hello as the bytes 48 65 6c 6c 6f.
  • • Reading a log line that already separates bytes with spaces or newlines.
  • • Checking that é is the two UTF-8 bytes c3 a9, not a single Latin-1 byte.

Example

Input

Hello

Output

48 65 6c 6c 6f

Encode mode. Each byte is two lowercase hex digits. Hello, World! is 48 65 6c 6c 6f 2c 20 57 6f 72 6c 64 21. Decode of the sample returns Hello.

How text becomes spaced bytes

Encode passes the field through a UTF-8 encoder and prints every byte as two lowercase hex digits, joined by a single space. Hello is 48 65 6c 6c 6f. A space in the text is 20. A newline is 0a, so a followed by a newline and b is 61 0a 62. é is c3 a9. The emoji 🙂 is f0 9f 99 82, four bytes, not one code point padded out. There is no option for uppercase, for a comma, for a 0x prefix, or for a continuous string without spaces.

Decode trims the field, splits on whitespace, and reads each token as hex. Several spaces, or a newline, count as one split, so 48 65 is still H and e. Uppercase tokens are accepted: 4C is the byte 0x4C. The bytes are then decoded as UTF-8. c3 a9 returns é. A token that contains no hex digit, such as zz or gg, throws Invalid hex input. The result is cleared and the status is that sentence, with no Error: prefix.

Encode, Decode, and Run

The two mode buttons sit in a group labeled Hex encode/decode mode. One is pressed at a time. Run is a separate button. Changing Encode to Decode only changes the field label and the placeholder. The previous result stays until Run. The result heading is Hex output in Encode and Decoded text in Decode. Copy output copies that text. Success statuses are Encoded to hex successfully. and Decoded from hex successfully.

An empty Encode field is a successful empty string. An empty Decode field, or a field of only spaces, splits to a blank token, and a blank token is not hex, so the status is Invalid hex input. Copy output after that error copies an empty string. There is no checksum, no byte-length counter, and no file picker on this page.

When spaced hex is the format you need

Use Encode when a log, a protocol note, or a ticket wants the UTF-8 bytes of a short string. Use Decode when those bytes are already separated. A whole integer written in several bases belongs on the number base converter. Decimal 255 there is the hex line FF. It is not the encoding of the three characters 255, which Encode would spell as 32 35 35.

Code points padded as binary groups belong on binary encode / decode. That page does not emit these hex pairs. Standard Base64 of a Latin-1 string belongs on Base64 encode / decode. Percent-encoding of a query value belongs on URL encode / decode. A \u escape for every character belongs on Unicode escape. None of those pages insert spaces between hex bytes.

Continuous hex, prefixes, and bytes above FF

Whitespace is the only separator. 48656c6c6f is one token. The token is parsed as a single integer and then kept as its low eight bits, so that run becomes the one character o, not Hello. 48,65 is also one token, because the comma is not whitespace. Parsing stops at the comma, the value is 0x48, and the result is H. A trailing junk letter is the same kind of stop: 48h is H, and the click succeeds. A 0x prefix on a token is accepted, so 0x48 is H.

A token above 255 is not rejected. 100 hex is 256, and the stored byte is 0, a null character. 1ff is 511, and the low eight bits are 0xFF. A lone FF is not the character ÿ. UTF-8 decoding of a stray 0xFF byte becomes the replacement character, because FF is not a valid UTF-8 start. ÿ itself encodes as c3 bf. If you needed Latin-1 bytes rather than UTF-8, this decoder will not provide them. Paste pairs, not a continuous dump, and keep each pair in the range 00 through ff.

Rules and limitations

Encode writes lowercase UTF-8 bytes separated by one space, two digits each. Decode splits on whitespace only. Letters in a token may be either case. A 0x prefix on a token is accepted.

A token with no hex digit, or an empty decode, sets Invalid hex input. and clears the result. Values above 255 keep the low eight bits. Empty encode returns an empty string and a success status. There is no download and no uppercase switch.

Common problems

If a long hex dump became one odd character, the bytes were not separated. Insert a space or a newline between pairs and run Decode again.

If FF became a replacement character, that byte is not valid UTF-8 by itself. é is c3 a9. If 48,65 became H, the comma glued the token together.

Frequently asked questions

Why is Hello written with spaces?

Encode always separates bytes with a space. Hello is 48 65 6c 6c 6f. There is no switch for a continuous string or for commas.

Can I paste hex without spaces?

You can, but the whole run is one token. Only the low eight bits are kept, so 48656c6c6f decodes as o, not as Hello.

What does an empty box do?

Encode succeeds with an empty result and says Encoded to hex successfully. Decode says Invalid hex input. and clears the result.

Is é one byte or two?

Two. Encode writes c3 a9. Decode of those two tokens returns é. A single Latin-1 byte is not what this page emits.

Is my input uploaded or saved?

This tool processes input in your browser and does not save its input or output to local storage. Copy and download are user actions. The site uses analytics for page and action metadata and may use ads and production error reporting; see the Privacy Policy for those services.

About this tool

Maintained by Toolbench. For large or deeply nested files, split the input into smaller batches and verify representative results before using them in an import or application. Report reproducible problems through Contact.

Next steps

Related tools

Continue the workflow with nearby tools for formatting, publishing, debugging, or follow-up checks.

Trust

Policies, contact, and answers

Clear pages for how Toolbench works, what we collect, and how to reach us.