Sign up free

Text to Hex Converter

Turn text into hexadecimal bytes, or hex back into text, in UTF-8, GBK or UTF-16.

About Text to Hex Converter

A text to hex converter shows the bytes behind a string. That's what you need when a log, a packet capture, a database export or a serial console gives you hex instead of words, or when you want to know exactly which bytes a piece of text is made of. Paste hex to read it as text, or paste text to see its bytes.

The encoding decides the bytes. 中 is E4 B8 AD in UTF-8, D6 D0 in GBK, 2D 4E in UTF-16LE and 4E 2D in UTF-16BE, so if decoded text comes out garbled, try another encoding. GBK here is handled as GB18030, which also covers GB2312. Bytes can be written with no separator, with spaces, or with 0x or \x, in upper or lower case, ready to paste into code or a hex editor. It all runs in your browser.

How to use Text to Hex Converter

  1. 1
    Choose the direction

    Text to hex, or hex to text.

  2. 2
    Pick the encoding

    UTF-8, GBK (GB18030), UTF-16LE or UTF-16BE.

  3. 3
    Set the format

    Separate bytes with nothing, spaces, 0x or \x, in upper or lower case.

  4. 4
    Copy the result

    Copy the hex or the decoded text.

Why use Cubfile for this

  • Four encodings

    UTF-8, GBK/GB18030 and UTF-16 in both byte orders.

  • A clear view of Chinese bytes

    See why the same character takes three bytes in UTF-8 but two in GBK.

  • Code-ready output

    Space, 0x or \x separators, with upper or lower case letters.

  • Local and offline

    Nothing is uploaded, and it works offline once the page has loaded.

FAQ

Text to Hex Converter: questions and answers

How do I convert hex to text?
Choose hex to text, paste the bytes and pick the encoding they were written in. If the result looks garbled, try another encoding. If the hex stands for a number rather than text, the Number Base Converter turns it into decimal.
Why is a Chinese character three bytes in UTF-8 but two in GBK?
The two encodings work differently. UTF-8 uses three bytes for most Chinese characters and GBK uses two, so 中 is E4 B8 AD in UTF-8 and D6 D0 in GBK.
What's the difference between UTF-16LE and UTF-16BE?
The order of the two bytes in each unit. 中, code point U+4E2D, is 2D 4E in little-endian and 4E 2D in big-endian. Windows normally uses little-endian. Any character's code point can be looked up in the Unicode Converter.
Why does my hex decode to garbled text?
The bytes were written in a different encoding. Hex from older Chinese systems and many Windows programs is often GBK, so switch from UTF-8 to GBK and look again.
Is my data uploaded when I convert hex to text?
No. The conversion happens in your browser, with no daily limit.
Share Text to Hex Converter with a friendIt runs in any browser, and they can try it without signing up.

Related tools

HASH Hash GeneratorGet MD5, SHA-1, SHA-256, SHA-512 and SM3 hashes of text in one go.
TIME Unix Timestamp ConverterConvert Unix timestamps to dates and back, in your time zone and UTC.
U+UNI Unicode ConverterConvert text to and from \u escapes, &#; codes, U+ points and UTF-8 bytes.
AES AES Encrypt and DecryptEncrypt or decrypt text with AES in GCM, CBC or CTR mode.
&;HTML HTML Entity Encoder/DecoderEscape text into HTML entities, or turn entities back into text.
JWT JWT DecoderDecode a JSON Web Token’s header and payload and check its expiry and signature.
01BIN Number Base ConverterConvert numbers between binary, octal, decimal, hex and any base up to 36.
BASE Base32 and Base58 EncoderEncode and decode Base32, Base58, Base85 and Base16.