What is mojibake?
Text is stored and sent as bytes using a character encoding. When a program reads those bytes with a different encoding than the one used to write them, you get garbled characters called mojibake. Japanese text has long been written in three encodings, UTF-8, Shift_JIS and EUC-JP, so each combination produces its own recognizable pattern. This tool tries every combination of “written as” and “read as” and shows the readable result.
Recognize the pattern
Real examples for the word 日本語 (“Japanese language”):
| What you see | Cause | Recoverable? |
|---|---|---|
日本語 | UTF-8 read as Latin-1 (Windows-1252) | Yes |
“ú–{Œê | Shift_JIS read as Latin-1 | Yes |
ÆüËܸì | EUC-JP read as Latin-1 | Yes |
譌・譛ャ隱� | UTF-8 read as Shift_JIS | Mostly, except the “�” parts |
縺薙s縺ォ縺。縺ッ (こんにちは) | UTF-8 read as Shift_JIS | Yes, if there is no “�” |
���{�� | Shift_JIS read as UTF-8 | No |
���ܸ� | EUC-JP read as UTF-8 | No |
Strings full of “ã”, “æ” or “Ô are UTF-8 read as Latin-1. Strings mixing kanji such as “縺”, “繧” with half-width katakana are UTF-8 read as Shift_JIS.
What can and cannot be restored
- Restorable: text misread as Latin-1. No bytes were lost, so it comes back almost perfectly.
- Partly restorable: UTF-8 misread as Shift_JIS. Bytes Shift_JIS cannot read were replaced by “�”, so those characters are gone.
- Not restorable: Shift_JIS or EUC-JP misread as UTF-8. “�” replaced the original characters and the bytes no longer exist. Reopen the original file with the correct encoding instead.
When invisible characters (such as byte 0x81) were dropped while copying, the tool fills in part of the hiragana by guessing and marks the result as partly restored.
Common situations
| Situation | Cause | Fix |
|---|---|---|
| CSV looks garbled in Excel | Excel reads UTF-8 without a BOM as Shift_JIS | Save as UTF-8 with BOM, or import via Data → From Text/CSV and choose 65001: Unicode (UTF-8). The CSV ⇔ JSON converter can also save with a BOM |
| Web page is garbled | The file encoding, <meta charset> and the Content-Type header disagree | Make all three UTF-8 |
| Database text is garbled | Table and connection encodings differ | Use utf8mb4 everywhere in MySQL and set it on the connection |
Email subject shows =?UTF-8?B?...?= | MIME (Base64) encoded header | Base64-decode it as UTF-8 |
| File names in a ZIP made on Windows are garbled on a Mac | Windows stores them in Shift_JIS (CP932) | Choose Shift_JIS in the unarchiver |
Not mojibake, just another notation
| You see | It is | Tool |
|---|---|---|
こん | HTML numeric character references | HTML Unescape |
\u3053\u3093 | Unicode escapes | Unicode Unescape |
%E3%81%93%E3%82%93 | Percent-encoding | URL Decode |
E3 81 93 E3 82 93 | Hexadecimal bytes | Hex Decoder |
Frequently asked questions
What does “�” mean and can it be restored?
“�” (U+FFFD, the replacement character) marks a spot where the original information was already lost while reading, so that character cannot be restored. If the characters around it are intact, this tool can still restore the readable parts.
What is “鐃緒申”?
It is what you get when the replacement character “�” is written as UTF-8 and then read as EUC-JP. The original characters are already gone, so the text cannot be recovered from this string. Reopen the original data instead.
What does “縺薙s縺ォ縺。縺ッ” say?
It says “こんにちは” (hello). Reading UTF-8 as Shift_JIS turns each hiragana into a kanji plus a half-width katakana. Paste it above to restore it.
What does “ã“ã‚“ã«ã¡ã¯” say?
It is also “こんにちは”, UTF-8 read as Latin-1 (Windows-1252). “ã” is the byte (E3) that starts most hiragana in UTF-8.
How do I check a file’s encoding?
On Mac or Linux, run file --mime-encoding filename or nkf --guess filename. In VS Code the current encoding is shown at the bottom right, and you can click it to reopen the file with another encoding.
Can I fix a file I already saved while garbled?
Usually not. Once garbled text is saved again in another encoding, the original bytes have been overwritten. Look for a backup or the original file. This tool only converts text and never changes files.
Is my text sent anywhere?
No. Everything runs in your browser and disappears when you close the page.