Encoding Tools
Text to UTF-8 hex.
Paste text and get its UTF-8 bytes in hex, in whichever notation your code, log or protocol expects. A table below shows which bytes belong to which character. Nothing is uploaded.
Example: Café is 43 61 66 C3 A9 in UTF-8, five bytes for four characters, because é (U+00E9) needs two bytes. The euro sign € is E2 82 AC, and 😀 (U+1F600) is F0 9F 98 80.
Inputs
Result
Reading UTF-8 hex
Hex is the usual way to look at bytes: each byte is two hex digits from 00 to FF. UTF-8 (RFC 3629) encodes every Unicode code point as 1 to 4 bytes, and the first byte tells you how long the sequence is: 00..7F is a whole character on its own, C2..DF starts a 2-byte character, E0..EF a 3-byte one and F0..F4 a 4-byte one. The bytes after the first always fall in 80..BF.
Which notation do I need? Spaced hex (E2 82 AC) is how hex editors, packet dumps and most documentation show bytes. The 0x list and { ... } forms paste straight into C, C++, Go or Rust arrays. \xE2\x82\xAC is the escape used inside string literals in C, Python (bytes literals) and many other languages. %E2%82%AC is percent-encoding, the same bytes that encodeURIComponent("€") produces in a URL. Note that \x escapes write bytes, not code points: for code point escapes such as \u20AC use the Unicode escape sequence converter.
Unpaired surrogates. A JavaScript string can contain a lone surrogate (for example from cutting an emoji in half). It has no UTF-8 form, so the page shows the replacement bytes EF BF BD (U+FFFD) and says so, which is also what TextEncoder does.
Sources: RFC 3629, UTF-8 (section 3) and The Unicode Standard, chapter 3 (Conformance) (Table 3-7), retrieved October 2026. To go the other way, use the UTF-8 decoder.
Frequently asked questions
How do I convert a string to UTF-8 hex?
Paste the string into the box. The output shows each UTF-8 byte as two hex digits. Choose a style to match where you will use it: spaced for reading, 0x for source code, \x for string literals or %XX for URLs.
Why is the hex longer than the number of characters?
Only ASCII characters are one byte in UTF-8. Accented letters take 2 bytes, characters such as € and most CJK take 3, and emoji take 4. The table under the output shows the byte count for every character.
Is UTF-8 hex the same as the Unicode code point?
No. The code point (for example U+20AC) is the character's number. The UTF-8 hex (E2 82 AC) is how that number is written as bytes. For ASCII they happen to match, which is why they are often confused.
Does UTF-8 hex include a byte order mark?
No. UTF-8 has no byte-order ambiguity, so a BOM (EF BB BF) is not needed and this tool never adds one. RFC 3629 section 6 describes it as an optional signature.
Can I use this for Python or C strings?
Yes. The \xE2\x82\xAC style is a valid bytes literal in Python and a valid string escape in C, and the C array style gives you an initialiser list. Check how your language treats the string encoding before you rely on it.