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
- 1Choose the direction
Text to hex, or hex to text.
- 2Pick the encoding
UTF-8, GBK (GB18030), UTF-16LE or UTF-16BE.
- 3Set the format
Separate bytes with nothing, spaces, 0x or \x, in upper or lower case.
- 4Copy 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.