What it does
This tool shows the bytes behind a piece of text and turns bytes back into text. Type a word and see it as binary (01001000 01101001), hexadecimal (48 69), decimal (72 105) or octal (110 151). Paste a string of bytes from a packet dump, a debugger or a homework exercise and read it as text again.
All conversion goes through UTF-8, so it works for every language and for emoji, not just for plain ASCII. That makes it easy to see why 你好 is six bytes long or why an emoji counts as four bytes in a database column.
How to use
- Choose Text → bytes to encode or Bytes → text to decode.
- Pick the number format: binary, hex, decimal or octal.
- When encoding, choose a separator between bytes (space, none, comma or new line), and whether hex letters are uppercase.
- Type or paste your input. The result updates as you type and can be copied or downloaded.
Decoding rules
When decoding, the tool is forgiving about layout:
- Bytes can be separated by spaces, commas, semicolons or line breaks, in any mix.
- Common prefixes are stripped:
0x,\xand%for hex,0bfor binary,0oor\for octal. - A long run without separators is split into fixed-width bytes: 8 digits for binary, 2 for hex and 3 for octal or decimal.
- A value above 255 or a digit that does not belong to the format is reported with its line and column.
Example
Encoding Hi 你好 as binary gives nine bytes: two for Hi, one for the space, and three for each Chinese character. The same text in hex is 48 69 20 e4 bd a0 e5 a5 bd, which is exactly what you would see in a hex editor or in a URL as %E4%BD%A0.
When it helps
Developers use it to check how text is stored on disk or sent over the network, to compare string lengths in bytes and characters, and to debug mojibake. Students use it to practise binary and hexadecimal by hand and check the answers.
FAQ
› Which character encoding does the tool use?
UTF-8, the encoding of the web. ASCII characters take one byte each, accented letters usually two, and Chinese, Japanese or Korean characters three. Emoji take four.
› Can I paste bytes with 0x or \x prefixes?
Yes. When decoding, prefixes such as 0x, \x and % for hex, 0b for binary and 0o for octal are removed, and spaces, commas, semicolons and line breaks all work as separators.
› Why do I get an error that the bytes are not valid UTF-8?
Some byte sequences cannot appear in UTF-8 text, for example a lone FF byte or a multi-byte character that is cut off. Check that you copied every byte and chose the right format.
› Is my text uploaded?
No. Encoding and decoding run in your browser.