How to use
- Paste the garbled text. Choose the language of the real text if you know it, which makes the result more certain, and how many layers to undo (4 is enough for most).
- Press Repair. The likeliest repairs are listed best first, each with the layers that were undone. A green mark means that garbling the repaired text in the same way gives back exactly the text you pasted, which is the proof that the repair is right.
- Open Show the steps to see the text after each layer. Use this result puts it in the box below, ready to copy.
- For a text file, use Open a file: the file is read in each encoding and the ones that read like real text come first. To undo layers by hand or garble text on purpose, use Step by step.
Examples
안녕하세요
→ 안녕하세요Korean in UTF-8 that was read as windows-1252, the most common cause of garbled Korean.
¾È³çÇϼ¼¿ä
→ 안녕하세요Korean in EUC-KR (CP949) that was read as windows-1252 or Latin-1.
été à Paris
→ été à ParisFrench accents in UTF-8 read as Latin-1. The same garbling can happen again on top of the first, and then two layers are undone.
How it works
Garbling is reversible when no information was lost. Text became bytes in one encoding, and the bytes were read in another, so the garbled text can be turned back into the same bytes by writing it in the wrong encoding, and then read in the right one. This tool does that for every pair of encodings it knows: UTF-8, EUC-KR (CP949), windows-1252, ISO-8859-1, Shift_JIS, EUC-JP, GBK, Big5 and several single-byte encodings. It reads bytes with the browser’s own decoder, so the encodings are the ones browsers apply, and it writes text in them with tables made by reading every possible byte and byte pair back through that decoder.
Which pair caused the garbling is not recorded anywhere, so the tool tries them all, scores each result by how much it reads like real writing, and keeps the best. The score looks at the characters: for Korean, a syllable from the 2,350 of KS X 1001 counts for much more than any other; for Chinese and Japanese the common characters count; for Western languages the accented letters of French, Spanish and German count; and replacement characters, control characters and the stray symbols that garbled text is full of count against. A text garbled several times is repaired layer by layer, keeping the best few results at each step.
It can also undo wrappers: percent codes (%EC%95%88), HTML character references (안), \u and \x escapes, hexadecimal, Base64, quoted-printable and email header words, alone or mixed with garbling. A repair is shown with a green mark only when garbling the result by the same layers gives back exactly the pasted text.
The limit is lost information. Garbling that replaces bytes by � or ? cannot be undone. In a test with seven Korean sentences, UTF-8 read as windows-1252, ISO-8859-1, windows-1250, windows-1251 or Mac Roman was repaired every time, and so was EUC-KR read as windows-1252 or ISO-8859-1; text garbled two to six times over was repaired every time with Korean chosen as the language, and six of seven at seven layers. With the language left on automatic one sentence in seven was missed, so choose the language when you know it. UTF-8 read as EUC-KR, Shift_JIS or Big5, and EUC-KR read as UTF-8, were not repaired, because a large share of the characters came out as �.
Sources
- WHATWG Encoding Standard: how browsers read each encoding
- Wikipedia: Mojibake
- Unicode: UTF-8 and the replacement character
Frequently asked questions
- What is mojibake, and why does text get garbled?
- Text is stored as bytes, and an encoding says which bytes mean which letters. When a program reads the bytes with a different encoding from the one used to write them, the letters come out wrong. UTF-8 read as windows-1252 turns 안녕 into 안녕. The word mojibake is Japanese for this.
- How do I fix garbled Korean text?
- Paste it and choose Korean as the language. If the garbled text is made of letters like ì, ë, í and symbols like • and …, it is UTF-8 read as Latin-1 or windows-1252. If it is made of letters like ¾, È, ³, ç, it is EUC-KR read the same way. Both are repaired completely.
- What does repairing several layers mean?
- Garbled text sometimes goes through the same mistake again, for example saved and reopened wrongly twice, so a second layer of garbling sits on top of the first. The tool undoes one layer, checks how the result reads, and undoes the next, up to the number you choose. In the tests, text garbled up to six times over was repaired.
- Why was my text not repaired? It has � or ? in it.
- The character � (and a ? where a letter was) is what a program writes when it meets bytes it cannot read. The bytes are gone from the text, so no tool can bring them back. This happens most when UTF-8 Korean is read as EUC-KR, or EUC-KR as UTF-8. Go back to the original file or source and read it with the right encoding. The Open a file tab does that.
- How do I know the repair is right?
- The tool checks it two ways. The repaired text should read like real writing in the language, and a green mark appears only when garbling the repaired text by the same layers gives back exactly what you pasted. If both agree, the repair is correct.
- How do I open a CSV or text file that shows garbled Korean?
- Use the Open a file tab. Excel and Notepad often save Korean as EUC-KR (CP949), while many other programs expect UTF-8. The file is read in each encoding, the ones that read like real text are shown first, and you can download the result as UTF-8.
- Is my text uploaded?
- No. Everything runs in your browser.
Related tools
Guides
Version history
- 1.0.1 — Clarifies the search title with the tool's main task and whether it is free or runs online.
- 1.0.0 — First release.