UTF-8 Encoder/Decoder - Inspect Text Bytes
Inspect text as UTF-8 bytes
This tool converts text to hexadecimal, binary, decimal or percent-escaped UTF-8 bytes. It also decodes those byte representations back to text. Use it to investigate an encoding problem or reproduce a small byte sequence before sending it to another application.
A reproducible example
Leave the mode at Text to Bytes and choose Hexadecimal. Enter Café. The result is 43 61 66 C3 A9: the accented letter needs two UTF-8 bytes. Switch the mode to Bytes to Text and the result becomes the original four code points.
For 🚀, the four supported representations are:
- Hexadecimal:
F0 9F 9A 80. - Binary:
11110000 10011111 10011010 10000000. - Decimal:
240 159 154 128. - Percent escapes:
%F0%9F%9A%80.
How to use the controls
- Choose the byte format from the menu.
- Paste source text in Text to Bytes mode, or encoded bytes in Bytes to Text mode.
- Read the result as you edit. Switching modes moves the current result into the input, which makes a round-trip check convenient.
- Copy the result when it is correct. Clear removes both input and output.
Changing format while decoding does not convert the input automatically: it interprets the existing input using the newly chosen format. Start with the representation you actually have.
Input rules and error checks
Hexadecimal accepts complete two-digit bytes, either contiguous or separated by whitespace. 436166C3A9 and 43 61 66 C3 A9 both work. A prefix such as 0x43, punctuation, an odd digit count or a partial byte is rejected rather than silently removed.
Binary requires exactly eight bits per byte. Decimal requires whitespace-separated integers from 0 to 255. 65oops, 1.5 and 256 are errors. Percent mode accepts byte escapes such as %41%20, with optional whitespace between them. Plain URL text and plus signs are not byte escapes; use the URL encoder for URL components.
The decoder rejects malformed UTF-8. For example, C3 is an incomplete accented-character sequence and FF is not a valid UTF-8 byte. Correct byte syntax alone does not make data valid UTF-8. If the source uses another character encoding, this tool cannot identify or decode it.
Processing, limits and troubleshooting
Conversion uses the browser's TextEncoder and TextDecoder. The tool does not send the entered text or bytes to a conversion API. The page may separately load site assets and analytics. Encoding is limited to 100,000 UTF-16 code units of source text; decoding is limited to 500,000 code units of the byte representation. Larger input produces an error and clears the old result.
Whitespace in source text is preserved: a single space becomes 20. A leading Unicode byte-order-mark character is preserved on decoding. Unpaired UTF-16 surrogates are replaced by the encoder's replacement character; they cannot round-trip as original invalid surrogate values.
If decoded text looks wrong without an error, confirm the original encoding and inspect the bytes with the source application. This converter does not repair mojibake, normalize Unicode, inspect files, provide a code-point table or encrypt text. To compare code points and byte length, open the UTF-8 counter.
Reference: WHATWG Encoding Standard.
Guide published by SimplyUtils. View our publishing information and contact details.