UTF-8 Converter
Convert text to UTF-8 bytes in any notation and back.
UTF-8 Converter – See the UTF-8 Bytes of Any Text
UTF-8 is the character encoding behind more than 98% of web pages, and most text files, APIs, and databases today. This converter shows exactly which bytes UTF-8 uses for your text – in hex, \x escapes, percent-encoding, decimal, binary, or octal – and turns any of those notations back into text.
How UTF-8 variable-length encoding works
UTF-8 stores each Unicode code point in one to four bytes. The first bits of the first byte say how long the sequence is, and every following byte starts with 10:
| Code point range | Bytes | Byte pattern | Example |
|---|---|---|---|
| U+0000 – U+007F | 1 | 0xxxxxxx | A → 41 |
| U+0080 – U+07FF | 2 | 110xxxxx 10xxxxxx | é → C3 A9 |
| U+0800 – U+FFFF | 3 | 1110xxxx 10xxxxxx 10xxxxxx | € → E2 82 AC |
| U+10000 – U+10FFFF | 4 | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx | 👋 → F0 9F 91 8B |
The x bits carry the code point. For é (U+00E9 = 00011 101001) the two bytes are 110+00011 = C3 and 10+101001 = A9. Because ASCII bytes never start with 1 and continuation bytes are always 10xxxxxx, a decoder can resynchronise after an error and ASCII text is automatically valid UTF-8.
Output formats
- Hex –
C3 A9, the form used in specifications and hex editors. - Hex escapes –
\xC3\xA9for Python bytes, C strings, and shellprintf. - Percent –
%C3%A9, exactly as it appears in a URL. - Decimal / Binary –
195 169or11000011 10101001for teaching and bit-level debugging. - Octal escapes –
\303\251, printed bygit,ls, and older tools for non-ASCII file names. - Mojibake view – shows the text as a Latin-1 reader would display it (
é).
Why look at raw UTF-8
Byte limits in databases (a VARCHAR(255) in bytes vs characters), percent-encoded query strings, file names escaped by Git, and HTTP Content-Length values all depend on the UTF-8 byte count, not the number of characters. To repair text that has already been garbled, use UTF-8 Decode; for URL-specific encoding, see URL Encode / Decode.
Frequently Asked Questions
How many bytes does a character take in UTF-8?
One to four. ASCII (U+0000–U+007F) takes 1 byte, Latin, Greek, Cyrillic, Hebrew, and Arabic letters take 2, most other scripts including Chinese, Japanese, and symbols like € take 3, and emoji and rare historic scripts take 4.
What is the 'Mojibake view (Latin-1)' option for?
It shows what your text looks like when a program wrongly reads its UTF-8 bytes as Latin-1 – for example 'é' turns into 'é'. Comparing this view with garbled text you have seen in an email or database is a quick way to confirm a UTF-8/Latin-1 mix-up.
Which formats does UTF-8 to Text accept?
Hex bytes with or without spaces (C3 A9), \x escapes (\xC3\xA9), URL percent-encoding (%C3%A9), octal escapes as printed by some shells and Python 2 (\303\251), and decimal byte lists (195 169). Escapes may be mixed with normal text, e.g. Caf\xC3\xA9.