Mojibake Decoder
Paste garbled text below. The tool will attempt to diagnose the encoding mismatch and show you the corrected text. Results update live in your browser — nothing is sent to a server.
Try an example:
Paste garbled text above.
What is mojibake?
Mojibake (文字化け, Japanese for "character transformation") is garbled text that appears when bytes are decoded using the wrong character encoding. The bytes are correct; the interpretation is wrong.
Common mojibake patterns
| Garbled | Correct | Cause |
|---|---|---|
| Café | Café | UTF-8 → Latin-1 |
| “quotes†| "quotes" | UTF-8 → Windows-1252 |
| Düsseldorf | Düsseldorf | UTF-8 → Latin-1 |
| привет | привет | UTF-8 → Latin-1 |
Common causes
- Database charset mismatch — Table declared as Latin-1 but storing UTF-8 bytes.
- Missing HTTP charset header — Browser guesses the wrong encoding.
- Legacy file conversion — File saved in Windows-1252, opened as UTF-8.
- Double-encoding — UTF-8 string encoded to bytes, then incorrectly treated as Latin-1 and re-encoded as UTF-8.
How to prevent mojibake
- Set your database to utf8mb4 (MySQL/MariaDB) or UTF-8 (PostgreSQL).
- Declare <meta charset="UTF-8"> in all HTML pages.
- Set Content-Type: text/html; charset=utf-8 in HTTP headers.
- Use UTF-8 everywhere and never mix encodings within the same data pipeline.
- When reading files, always specify the encoding explicitly rather than relying on defaults.