What is mojibake?

Mojibake is text that turns into gibberish such as é instead of é or ’ instead of ’. It appears when text is saved in one encoding and read in another – and in most cases it can be fully repaired. Paste a broken text below to try it.

Works with text and these files:

  • CSV
  • TXT
  • JSON
  • XML
  • SRT
  • VTT
  • TSV
  • MD
  • HTML
  • SQL
  • LOG

For example Excel exports, database dumps, subtitles or website code.

Repair

  1. Drop a file or paste text
  2. It gets repaired automatically
  3. Copy or download
or simply drag a file here

Where the word comes from

Mojibake (文字化け) is Japanese: “moji” means “character” and “bake” means “transformation”. In the 1990s, Japanese computers used several encodings side by side – Shift_JIS, EUC-JP and ISO-2022-JP – so garbled e-mails and web pages were an everyday sight. The word stuck and moved into English.

How mojibake happens

Computers store text as bytes. An encoding defines which bytes stand for which character. In UTF-8, é is stored as the two bytes C3 A9. A program that reads these bytes as Windows-1252 shows one character per byte: Ã for C3 and © for A9.

Nothing is lost in this step – the bytes are still there, they are only read the wrong way. That is why mojibake can usually be undone: Mojibuster turns the wrong characters back into bytes and reads them correctly.

UTF-8 text read as Windows-1252

Mojibake

Café, naïve, résumé – €5

Repaired

Café, naïve, résumé – €5

Mojibake in other languages

  • Japanese: 縺薙s縺ォ縺。縺ッ instead of こんにちは – UTF-8 read as Shift_JIS. More on the Japanese page.
  • Chinese: 浣犲ソ instead of 你好 – UTF-8 read as GBK. In Chinese it is called 乱码 (luànmǎ, “chaotic code”).
  • Russian: Привет instead of Привет – UTF-8 read as Windows-1251. Russians call it “krakozyabry”.
  • Western languages: ä, ñ or € instead of ä, ñ or € – the most common form worldwide.

Typical causes

Can mojibake always be fixed?

Almost always, as long as the bytes are still intact. It becomes impossible once a program has replaced the characters with ? or the replacement character � – the original information is gone then. Mojibuster repairs everything that can be repaired and tells you how many spots are lost. More: question marks instead of characters.

How to prevent mojibake

  • Save files as UTF-8 – CSV files for Excel as UTF-8 with BOM.
  • Declare the encoding: <meta charset="utf-8"> in HTML, utf8mb4 in MySQL and MariaDB.
  • Convert text only once, at the boundary between two systems.
  • When importing, choose the encoding explicitly instead of letting the program guess.

Frequently asked questions

How do you pronounce mojibake?

Roughly “MO-jee-bah-keh”, with all four syllables spoken. The Japanese word has no stress accent like English words.

Is my file damaged or infected?

No. Mojibake is a display problem, not a virus and usually no data loss. The file is only read with the wrong encoding.

What is the difference between mojibake and �?

Mojibake like é still contains the original bytes and can be repaired. The character � means a program could not read a byte and replaced it – that character is lost.

Is my text uploaded?

No. Mojibuster repairs the text in your browser. It is neither transferred nor stored.

More guides