UTF-8 decode bytes and fix mojibake
The UTF-8 decode tool reads a sequence of bytes as UTF-8 and returns the text they represent. It accepts the byte notations you meet in real life — Python-style \xC3\xA9 escapes from logs, hex dumps, decimal byte lists, percent-encoding — and it can repair “mojibake”, the garbled text produced when UTF-8 is read with the wrong character set.
Input formats
| Byte format | Example input | How it is read |
|---|---|---|
| Escaped bytes | caf\xC3\xA9 | \xHH sequences become bytes; other characters are kept as text |
| Hex bytes | 63 61 66 C3 A9 | Two-digit hex values, separators optional |
| Decimal bytes | 99 97 102 195 169 | Numbers from 0 to 255 |
| Percent | caf%C3%A9 | %HH sequences, as in URLs |
| Latin-1 view | café | Each character is taken as one byte |
Pick the Byte format that matches your input; the same setting controls the output when you type on the Text side, so you can switch directions freely.
Example
Input:
Gr\xC3\xBC\xC3\x9Fe aus K\xC3\xB6ln \xE2\x80\x94 \xE6\x9D\xB1\xE4\xBA\xACOutput:
Grüße aus Köln — 東京
Repairing mojibake
When UTF-8 text is decoded as Latin-1, each byte becomes its own character, so “café” turns into “café”. Paste the garbled text with the Latin-1 view byte format and the tool re-reads those characters as bytes, restoring the original:
Garbled:
café crèmeRepaired:
café crèmeThis works for true Latin-1 mojibake. Text that went through Windows-1252 contains characters such as “Ÿ”, “€” or “™” for bytes 0x80–0x9F; these are not turned back into bytes, so sequences containing them are not repaired. Invalid sequences show up as the replacement character �, pointing you to the damaged spots (in the Percent format they stay as %XX instead).
A leading byte order mark (EF BB BF) is dropped during decoding, as UTF-8 decoders normally do, so it will not appear as an invisible character at the start of your output. The Percent format is the exception: %EF%BB%BF is decoded and kept.
Common mojibake patterns
The same few garbled sequences account for most broken text. Each one is the UTF-8 form of a character read as Windows-1252:
| You see | Intended | UTF-8 bytes |
|---|---|---|
’ | ’ | E2 80 99 |
“ | “ | E2 80 9C |
— | — | E2 80 94 |
ü / ö | ü / ö | C3 BC / C3 B6 |
The Latin-1 view repairs only the last row. The first three contain Windows-1252-only characters (€, ™, œ, ”), which this tool does not turn back into bytes: ’ comes out as �€™. If you see é instead of é, the text was mis-decoded twice and contains such a character too, so it is not repaired here either; the Python library ftfy is designed for these cases.
Where these bytes come from
- Python
bytesprinted withrepr(), such asb'caf\xc3\xa9'. - Database and log tools that show non-ASCII bytes escaped.
- Hex dumps from
xxd, Wireshark or a hex editor; for plain hex also see Hex to UTF-8. - CSV files opened in Excel with the wrong encoding.
To go the other way, use UTF-8 Encode. Decoding runs in your browser.