Skip to content
UniKit

HEX and text converter

Convert hex byte strings to text and back: separators like spaces, commas, 0x, \x and %, UTF-8 or UTF-16 byte width, correct multi-byte restoration, configurable case and bytes per line, with explicit errors for odd digit counts and truncated UTF-8.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Encoded with the selected width: UTF-8 variable bytes (3 bytes for CJK) or UTF-16 code units (4 digits each).

Result

The deterministic text is ready to copy or download.

Enter content to see the result

What this tool does

  • Debug hex byte strings from serial ports, network packets or logs
  • Turn 0x / \x / % escapes back into readable text, or generate the escapes
  • Inspect the UTF-8 bytes of CJK text or emoji to see whether a sequence was truncated

Example

Input

Hi

Output

48 69

With the UTF-8 width each ASCII character is one byte; switch to UTF-16 to get 0048 0069.

Frequently asked questions

How does decoding pick single or double byte?

By default it checks whether every group is exactly 4 hex digits: if so the data is decoded as UTF-16 code units, otherwise as bytes (UTF-8). You can also force the width to UTF-8 or UTF-16.

Why does decoding report invalid-utf8?

The bytes are not valid UTF-8: the sequence may be truncated (E4 B8 is missing its last byte), overlong, or inside the surrogate range. Turning off strict validation replaces the bad bytes with U+FFFD and continues.

Is GBK / GB18030 supported?

No. This tool only converts between UTF-8 and UTF-16 at byte level; GBK needs a full code table mapping that is not bundled here, so no unreliable guesses are made.

Does "bytes per line" affect decoding?

No. It only controls where the encoded output wraps; during decoding line breaks are ignored like any other separator.

Which separators are accepted?

No separator, spaces, commas, newlines, colons, semicolons and dashes, plus the 0x / \x / % prefixes; the output can use six of them.

Keywords:hex to texthex decoderutf-16

Related tools