Hex to Text Converter

Convert between text and hex with several separator styles

Runs in your browserUtility03Encoding & Crypto

What is Hex to Text Converter?

This hex converter translates in both directions between text and hexadecimal byte strings, encoding multi-byte characters as UTF-8. Output can be space-separated, packed into one continuous run, or prefixed with 0x for pasting into code. The conversion runs locally in your browser.

How to use Hex to Text Converter

  1. 1Choose a direction: text to hex, or hex to text.
  2. 2When encoding, pick an output style so the result can be pasted directly into a byte array in your code.
  3. 3When decoding, spaces, 0x prefixes, and other noise are stripped automatically.

Frequently asked questions

Why does one CJK character take three bytes?+

Under UTF-8, ASCII characters take one byte while common CJK characters such as 你 fall in the three-byte range, and many emoji take four. That is why a hex string is often far longer than the character count suggests. If the other system uses a legacy encoding such as GBK, where the same character is two bytes, your hex output will not match theirs — agree on UTF-8 first.

Decoding fails with "length must be even" — what now?+

Each byte is two hex characters, so an odd length means the string was truncated or picked up a stray character. Check for a missing leading zero, for example 0f written as just f.

Related tools

All tools