Convert UTF-8 text to hexadecimal
How a UTF-8 hex converter works, what the hex output represents, a compact UTF-8 byte table, and when hex is or isn't the right form for your text.
Converting UTF-8 text to hexadecimal replaces each character with the bytes that encode it, written as pairs of hex digits. The word "Hi" becomes 48 69, and "café" becomes 63 61 66 C3 A9. This review covers what the conversion changes, how to read the output with a UTF-8 hex table, and where hex helps or gets in the way.
Is hex conversion suitable for your use?
Hex is a good choice when you need to see or transmit the exact bytes behind a piece of text. Typical cases include debugging encoding problems, comparing two strings that look identical, finding invisible characters, writing byte-level test fixtures, and passing text through a channel that only accepts the characters 0–9 and A–F. The conversion loses nothing. Decoding the hex as UTF-8 returns the original text byte for byte.
The main tradeoff is that people can no longer read the text. Hex output cannot be skimmed, searched for the original words, or edited as prose. It is also at least twice as long as the input, and longer for non-Latin scripts. Use plain text whenever the audience is human: messages, documents, labels, social posts, or anything a screen reader user needs to hear. Hex is also not encryption. Anyone with a decoder can reverse it, so it offers no confidentiality.
What the conversion actually changes
This is a change to the stored characters, not to how they are displayed. It is unrelated to text reversal, mirrored glyphs, decorative Unicode "fonts", or CSS styling, all of which keep the text readable in some form. After conversion, the stored content is a new string of ASCII hex digits that describes the original byte sequence. Nothing about the result will look like the source text.
The process has two steps. First, each Unicode code point is encoded as one to four bytes according to UTF-8 rules. Second, each byte is written as two hexadecimal digits. Output may be contiguous (636166C3A9), space-separated (63 61 66 C3 A9), prefixed (0x63 0x61), or written as escapes (\x63\x61). Upper- and lowercase hex digits mean the same thing.
Three things people confuse with UTF-8 hex
- Code point notation: é is code point U+00E9, but its UTF-8 bytes are C3 A9. A converter that outputs 00E9 is showing the code point or UTF-16, not UTF-8.
- Percent-encoding in web addresses uses the same UTF-8 bytes with a % before each pair, so é appears as %C3%A9.
- Reversing hex: UTF-8 has no byte order, unlike UTF-16, so there is no little-endian variant to switch to. Reversing the order of bytes or digit pairs breaks multi-byte characters and usually produces invalid UTF-8.
UTF-8 hex table
Use this table to read hex output. Any byte from 80 to BF is a continuation byte and never starts a character. The first byte of a sequence tells you how many bytes follow.
| Code point range | Bytes | Bit pattern | First byte (hex) |
| U+0000–U+007F | 1 | 0xxxxxxx | 00–7F |
| U+0080–U+07FF | 2 | 110xxxxx 10xxxxxx | C2–DF |
| U+0800–U+FFFF (excluding surrogates U+D800–U+DFFF) | 3 | 1110xxxx 10xxxxxx 10xxxxxx | E0–EF |
| U+10000–U+10FFFF | 4 | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx | F0–F4 |
The bytes C0, C1 and F5 through FF never appear in valid UTF-8. If you see them, the data is either another encoding or corrupted.
| Character | Code point | UTF-8 hex |
| A | U+0041 | 41 |
| space | U+0020 | 20 |
| no-break space | U+00A0 | C2 A0 |
| é (precomposed) | U+00E9 | C3 A9 |
| € | U+20AC | E2 82 AC |
| 😀 | U+1F600 | F0 9F 98 80 |
| zero-width joiner | U+200D | E2 80 8D |
| byte order mark | U+FEFF | EF BB BF |
Worked example for €: U+20AC is 0010 0000 1010 1100 in binary. Split those bits into groups of 4, 6 and 6 (0010, 000010, 101100) and place them into the three-byte pattern. The result is 11100010 10000010 10101100, which is E2 82 AC.
Combining marks and emoji sequences
Hex shows what is really stored, and two strings that look the same can produce different output. A precomposed é is C3 A9. An e followed by a combining acute accent (U+0301) is 65 CC 81. Multi-part emoji are sequences of several code points. The family emoji 👨👩👧 is man, zero-width joiner, woman, zero-width joiner, girl, which is F0 9F 91 A8 E2 80 8D F0 9F 91 A9 E2 80 8D F0 9F 91 A7. If you are comparing hex from two sources, normalize both inputs first (for example, to NFC) or expect mismatches.
Converting in code
Built-in language functions give predictable, local results without any online tool:
# Python 3.8+
"café".encode("utf-8").hex(" ") # '63 61 66 c3 a9'
bytes.fromhex("63 61 66 c3 a9").decode("utf-8") # 'café'
// JavaScript
Array.from(new TextEncoder().encode("café"),
b => b.toString(16).padStart(2, "0")).join(" "); // '63 61 66 c3 a9'
Will the result stay usable after copying or sharing?
Hex output uses only basic ASCII letters and digits, so it usually survives copy and paste better than the original text did. It can still be damaged in transit:
- Editors or chat apps may wrap long lines or insert spaces. Most decoders ignore whitespace, but some reject it.
- A missing or extra digit shifts every pair after it and makes the rest of the output decode incorrectly.
- Decoding with the wrong encoding produces garbled text. For example, C3 A9 read as Latin-1 displays as é instead of é.
- Hidden differences in the source are kept: CRLF line endings (0D 0A) versus LF (0A), trailing spaces, and a leading byte order mark (EF BB BF) all change the hex.
- Hand-editing hex can easily create invalid sequences, such as a lead byte without its continuation bytes.
For accessibility and search, hex removes meaning. Assistive technology receives a run of letters and digits instead of words, and search engines or in-page search will not match the original terms. No documentation or screen reader tests were supplied for this review, so specific announcement behavior is not described here. In general, wherever a person needs to understand the content, provide the plain-text version alongside or in place of the hex. Reserve hex for technical contexts such as logs, code, test data, and bug reports, where the bytes themselves are the point.
A note on online converters
No specific converter was evaluated for this review. Claims about any tool's accuracy, handling of invalid input, or data retention cannot be confirmed from its appearance or marketing. For sensitive text, convert locally with the code above. To check a converter, paste in a few known inputs from the tables, such as € (E2 82 AC), a decomposed é (65 CC 81), and an emoji, and compare its output.