Security

Text to Hex Converter

Converts text to its hexadecimal bytes and back, which is how you see what a string is actually made of.

Loading the tool…

Processing happens locally in your browser. What you paste or load is processed by this page and is not uploaded to a server. Nothing is stored unless you use a control that says it stores something, and you can clear anything this site has kept from the privacy page.

How to use this tool

  1. Paste text to encode, or hexadecimal bytes to decode.
  2. Set the direction, and a separator if you want the bytes spaced out for reading.
  3. Select Convert. Decoding accepts spaces, colons, hyphens and a 0x prefix.

What hex converter does

Hex is how you look at bytes rather than at characters. It is the format checksums, keys, colour values and protocol dumps are written in, and it is the quickest way to settle an argument about what is really in a string — because in hex there is nowhere for an invisible character to hide.

The conversion is over UTF-8 bytes, which is what makes it informative. A plain ASCII character is one byte, an accented Latin letter is two, most CJK characters are three and an emoji is four. Seeing héllo come out as eleven hex pairs rather than ten explains, immediately, why a value that looked short enough was rejected by a column with a byte-based length limit.

Frequently asked questions

Continuous hex, or bytes separated by spaces, colons or hyphens, with or without a 0x prefix. It rejects an odd number of digits, because hexadecimal bytes come in pairs and an odd count means something was truncated.

Because the conversion is over UTF-8 bytes. ASCII characters are one byte each, but an accented Latin letter is two, most CJK characters are three and an emoji is four. That difference is exactly why a byte-based column limit rejects text that looked short enough.

That the bytes do not form a valid text encoding — they are probably binary data, or text in a different encoding such as Latin-1. Either way they are not a UTF-8 string, and decoding them as one would produce nonsense rather than an answer.