Mojibake Fixer & Decoder | Restore 縺・繧・ã・‚ƒ, Convert Email Subjects, %E3 and CSV Encodings

Paste garbled text and the tool brute-forces which combination of UTF-8, Shift_JIS, EUC-JP and Latin-1 caused it, then restores readable Japanese. Characters lost to “�” (UTF-8 opened as Shift_JIS) are inferred from the rules of the encoding, and you can pick other candidates. It also handles text garbled twice and JIS emails whose ESC characters were lost ($B…(B). It reads email subjects (=?UTF-8?B?…?=, =?ISO-2022-JP?B?…?=), URL %E3%81%82, JSON \u3042, git \343\201\202, Python \xe3, HTML あ, Quoted-Printable and xn-- Japanese domains. For CSV and other files it detects the encoding, BOM and line endings, and converts to Excel-safe UTF-8 (with BOM) or Shift_JIS. Everything is processed in your browser; your text and files are never sent anywhere.

Paste the garbled text

Paste the garbled characters from an email, CSV, web page, etc. as they are. The tool tries every likely way the text could have been garbled and lines up the results that read as Japanese.

Try an example:

ABOUT

About Mojibake Fixer & Decoder | Restore 縺・繧・ã・‚ƒ, Convert Email Subjects, %E3 and CSV Encodings

The Mojibake Fixer & Decoder restores garbled Japanese text. Mojibake happens when text saved in one character encoding is read as another. For example, UTF-8 “こんにちは” read as Shift_JIS becomes “縺薙s縺ォ縺。縺ッ”, read as Latin-1 (Windows-1252) becomes “ã“ã‚“ã«ã¡ã¯”, and Shift_JIS text read as Latin-1 becomes “‚±‚ñ‚É‚¿‚Í”. This tool re-reads the pasted text in every combination of UTF-8, Shift_JIS, EUC-JP and Latin-1 and lines up the ones that look like natural Japanese. The “�” that appears when UTF-8 is read as Shift_JIS marks one or two lost bytes, but the tool works out the number and position of the missing bytes from the structure of UTF-8 and infers readable characters to fill in (click an inferred character to swap in another candidate). It also handles JIS emails that lost their ESC characters ($BJ8;z2=$1(B → 文字化け), text garbled twice, email subjects such as =?UTF-8?B?…?= and =?ISO-2022-JP?B?…?=, URL %E3%81%82, JSON \u3042, git \343\201\202, Python \xe3\x81\x82, HTML あ, Quoted-Printable, and xn-- Japanese domains. For CSV and other files it detects the encoding, BOM and line endings, and converts to Excel-safe UTF-8 (with BOM) or Shift_JIS.

How to use Mojibake Fixer & Decoder | Restore 縺・繧・ã・‚ƒ, Convert Email Subjects, %E3 and CSV Encodings

  1. 1Paste the garbled text (a string of characters like 縺・繧・ã・‚) as it is into the “Fix mojibake” field
  2. 2Check the text shown as “Best match”; it also shows which encoding combination caused the garbling
  3. 3Yellow characters are inferred from a “�”; if one is wrong, click it to swap in another candidate
  4. 4Press “Copy restored text” to copy it
  5. 5Text that is still in escaped form, such as %E3%81%82 or =?UTF-8?B?…?=, goes into “Read escapes”
  6. 6For CSV and other files, choose the file under “Files & CSV”, pick the encoding to save in (UTF-8 with BOM or Shift_JIS), and press “Convert & save”

Great for

  • You want to read an email or web page full of “縺”, “繧” and “譁”
  • You want to restore WordPress or database text showing “ã”, “— and “é”
  • An email subject shows as =?UTF-8?B?… or =?ISO-2022-JP?B?… and is unreadable
  • You want to read an old email where alphanumerics sit between “$B” and “(B”
  • A UTF-8 CSV is garbled in Excel, so you want to convert it to BOM-prefixed UTF-8 or Shift_JIS
  • You want to check the encoding and line endings of a CSV or text file you received
  • You want to read URL %E6%96%87…, JSON \u3042, or log \xe3\x81 sequences as Japanese
  • You want to read Japanese filenames that git status shows like \343\201\202

Good to know

  • Garbled text is converted back to bytes using the encoding it was wrongly read as, then re-read in the original encoding. The encoding tables come directly from your browser’s own decoder (WHATWG Encoding).
  • “�” (U+FFFD) marks bytes that could not be read and were discarded. A “�” from UTF-8 read as Shift_JIS stands for one or two bytes, so it can be inferred from the surrounding bytes, but because it is a guess it may turn out to be a different character. Characters shown in yellow can be clicked to choose other candidates.
  • Text in Shift_JIS or EUC-JP that was read as UTF-8 and turned into nothing but “�”, or text where characters were replaced with “?” when saved, cannot be restored because the original data is gone. Reload the original file under “Files & CSV”.
  • If invisible characters (such as Latin-1 control characters) were dropped while copying, those parts are also filled in by inference. The more faithfully you paste the original text, the more accurately it is restored.
  • A file’s encoding is detected in this order: BOM, whether it reads as valid UTF-8, whether ESC (JIS) is present, and which of Shift_JIS or EUC-JP looks more like Japanese. Files with only alphanumerics are hard to judge, so check the preview and change the encoding to read with if needed.
  • When saving as Shift_JIS, characters not in Shift_JIS, such as emoji and “𠮷”, become “?”. Which characters cannot be written is shown before saving.
  • Text and files are processed only in your browser and are never sent to a server.

Questions this tool answers

Use Mojibake Fixer & Decoder | Restore 縺・繧・ã・‚ƒ, Convert Email Subjects, %E3 and CSV Encodings for searches like these:

  • Fix mojibake full of 縺 and 繧
  • Restore garbled text with ã and â€
  • Read the =?UTF-8?B? in an email subject
  • Turn $B…(B in an email into Japanese
  • Fix a CSV that is garbled in Excel
  • Find out whether a file is UTF-8 or Shift_JIS
  • Turn a URL like %E3%81%82 into Japanese
  • Read \343 in git Japanese filenames

FAQ

What causes mojibake full of “縺” and “繧”?
Text saved as UTF-8 was displayed as Shift_JIS. Hiragana in UTF-8 are three bytes like “E3 81 xx” and “E3 82 xx”, and reading “E3 81” and “E3 82” as Shift_JIS gives “縺” and “繧”, so the more hiragana a text has, the more of them line up. For example, “こんにちは” becomes “縺薙s縺ォ縺。縺ッ”. Paste it into this tool to restore it, including characters lost to “�”, which are inferred.
Can mojibake like “ã”, “— and “é” be restored?
Yes. This is how UTF-8 text looks when displayed as Latin-1 (Windows-1252), and it often happens with overseas software or when the character set of a database such as WordPress or MySQL is wrong. “こんにちは” becomes something like “ã“ã‚“ã«ã¡ã¯”. If it was garbled twice in a row it gets longer, like “ã”, but both rounds can be undone together.
Can text that is all “�” or “???” be restored?
In most cases, no. “�” marks bytes that could not be read and were discarded; when Shift_JIS or EUC-JP text is read as UTF-8, most characters become “�” and no original data remains. “?” replaces characters that could not be written when saving, so the data was already gone at that point. If you still have the original file or email, load it under “Files & CSV” or reopen it after switching the software’s encoding.
Why does a CSV look garbled when opened in Excel?
Japanese-edition Excel opens a CSV without a BOM as Shift_JIS. Most CSVs written by web services and programs are UTF-8, so they look garbled as they are. Convert and save as “UTF-8 (with BOM)” under “Files & CSV” in this tool and it opens correctly with a double-click. If you are feeding it to an old program or an internal system, choose “Shift_JIS”.
What is “=?UTF-8?B?…?=” in an email subject?
It is a notation for putting Japanese into email headers (MIME encoding): “?B?” means the text is encoded in Base64 and “?Q?” means Quoted-Printable. If the mail client does not support it, it is shown as is. For example, “=?UTF-8?B?44GK6KaL56mN44KC44KK44Gu44GU5L6d6aC8?=” is “お見積もりのご依頼” (“request for a quote”). Paste it under “Read escapes” to turn it, along with =?ISO-2022-JP?B?…?=, back into Japanese.
Why do alphanumerics appear between “$B” and “(B” in an email?
This is Japanese written in JIS (ISO-2022-JP) from which the invisible ESC characters that signal switching have been lost. In JIS, the text from “ESC $ B” to “ESC ( B” is Japanese, so when the ESC is gone only alphanumerics remain, like “$BJ8;z2=$1(B” (= 文字化け). Paste it into this tool and it puts the ESC back and restores the original Japanese.
git shows Japanese filenames like “\343\201\202”.
By default git displays filenames containing non-ASCII characters as the UTF-8 bytes written in octal (\343\201\202 = “あ”). Paste it under “Read escapes” to read it. To make git display Japanese as is, run git config --global core.quotepath false.