Also available in: Español · Português · Français · العربية
Fix garbled text (mojibake)
Repairs text that was written as UTF-8 and read through the wrong table, and shows you exactly what it changed.
What is mojibake?
A file holds bytes. A character encoding is the agreement that turns those bytes into letters, and mojibake is what you get when the writer and the reader use different agreements. The text was written as UTF-8, where é is the two bytes C3 A9, and something read it back through a single-byte table where those two bytes are two separate letters — Ã and ©. Nothing was corrupted in transit. The bytes are intact and are being read by the wrong rulebook.
That is why the damage is so recognisable. Ã, Â, â and € cluster in front of accented letters, an apostrophe becomes ’, and a dash becomes –. Once you know the shape you can read it: ’ is always a right single quotation mark, seen through Windows-1252.
It also means the repair is exact rather than a guess. If the bytes survived, mapping every character back to the byte it came from and reading those bytes as UTF-8 returns the original text — not something close to it, the original. Over all 1,112,032 code points Unicode can assign, that round trip through Windows-1252 succeeds every single time.
How to fix it
- Paste the garbled text. One field, name, line or cell at a time works best. Each line is repaired on its own, so a document with one broken column and eleven good ones is fine.
- Read the repaired text, then read the pairs underneath it. Every output character is shown beside the exact characters it replaced. If é became é and ’ became an apostrophe, the repair is right. If something you meant to keep is in that list, it is not.
- Copy it back. If nothing is repaired, the panel says which of the two reasons applies — the text is already clean, or no table accounts for every character in it.
Why this one refuses more often than others
A repair tool has a failure mode nobody talks about: rewriting text that was never broken. It is worse than doing nothing, because the output looks plausible and the reader has no reason to check.
The measurement is easy to run and this site has 19,655 lines of correct Spanish, Portuguese, French and Arabic prose sitting in its own pages. Through ftfy, the reference implementation everyone builds on, the obvious top-level function rewrites 2,514 of them — 12.8 per cent — because it also straightens curly quotes, which has nothing to do with encoding. Its careful function rewrites five. Four of those five are the same paragraph explaining what a character encoding is, in four languages, because that paragraph quotes the mojibake it is describing. The fifth is a Portuguese sentence about the letter Ã.
This tool rewrites none of them, for one structural reason: it repairs a whole line at once. Every character has to map back to a byte and the whole byte string has to be valid UTF-8, so a single genuinely accented letter elsewhere in the line vetoes the repair. In the French sentence the words là où contribute the bytes E0 20, which no UTF-8 sequence can be, and the line is left alone.
The price is real and worth knowing. If your mojibake was itself damaged afterwards — a no-break space flattened into an ordinary space by a mail system, say — the byte string no longer adds up and this tool will decline where a lenient one would guess. Paste a shorter fragment and it will often work.
Honest limits
Only single-byte tables are tried. Twenty-seven of them by default, plus Mac Roman behind a checkbox. Mac Roman is held back for a measured reason rather than a hunch: it puts the curly apostrophe on a byte that opens a UTF-8 sequence, so ordinary French like l’échelle reads as valid mojibake, and it is the only one of the twenty-eight tables that fires on prose that was never broken.
Not every table can be undone. Nineteen of the twenty-eight assign all 256 bytes, and mojibake through those is always reversible. The other nine leave bytes unassigned — ISO-8859-6 leaves 45 of them — and a byte that landed on one of those was replaced when the text was first read, so it is gone before you get here. The panel says which case you are in.
Sometimes more than one table explains the same text and they disagree. The most likely reading is reported and the others are listed rather than hidden, because the text alone does not say which is right. Latin mojibake is usually explained identically by a dozen tables; Cyrillic mojibake is normally explained by exactly one.
One character needs care even when everything else works. A byte-order mark at the start of a line, U+FEFF, is deleted by a UTF-8 decoder unless it is explicitly told to keep it — this tool tells it to, which is a one-line difference that most implementations get wrong.
Finally, no tool can tell a quoted example from real damage. A page about mojibake contains mojibake on purpose. That is why the changes are shown paired up instead of being applied silently.
Why is it free?
Everything happens in your browser. The character-to-byte tables are not shipped with the page — they are read out of your own browser's decoder, 256 bytes at a time, which costs nothing and means the answer is what your browser actually believes each table is.
Nothing is uploaded. There is no server to pay for, so there is no account, no limit and no watermark.