Fix garbled text (mojibake)
Runs in your browserPaste text with broken characters like ä, é or ’, or open a CSV export. The tool finds out what went wrong and restores the original.
Garbled text, repaired
UTF-8 text was read as Windows-1252. Reading the bytes as UTF-8 again restores it.
Müller, Größe, Straße
ü→ ü (bytes C3 BC)ö→ ö (bytes C3 B6)ß→ ß (bytes C3 9F, 2×)
Shown: the “Excel export” example. Paste your own text on the left.
- File
- Encoding
- Garbled characters
What you see, and what it should be
The broken characters give away what happened. Every example in the table runs through the same repair as the tool.
| You see | It should be | What happened | Fixable |
|---|---|---|---|
ä ö ü ß | ä ö ü ß | UTF-8 read as Windows-1252 or Latin-1. The classic from Excel and old databases. | Yes |
é è à ç | é è à ç | Same, with French or Spanish accents. | Yes |
It’s – ok | It’s – ok | Curly quotes and dashes: three bytes each in UTF-8. | Yes |
5 € | 5 € | The euro sign, read as Windows-1252. | Yes |
20 °C | 20 °C | A stray  in front of a symbol or space. | Yes |
ä | ä | Garbled twice: the broken text was saved as UTF-8 and read wrongly again. | Yes |
Name | Name | A byte order mark (BOM) at the start of the file, read as Windows-1252. | Yes |
√§ | ä | UTF-8 read as Mac OS Roman (old Mac programs). | Yes |
├ñ | ä | UTF-8 shown in a Windows console (code page 850). | Yes |
Ĺ™ Ĺ‚ | ř ł | Central European text read as Windows-1250. | Yes |
caf� or caf? | café | The bytes were replaced on the way. That information is lost. | Lost |
???? | 😀 | MySQL utf8 (3 bytes) instead of utf8mb4 dropped the emoji. | Lost |
Why ä turns into ä
Computers store text as bytes. UTF-8, the standard on the web, needs one byte for A–Z and two or more for everything else. A program that expects Windows-1252 or Latin-1 reads one character per byte, and every umlaut falls apart into two characters.
The repair runs the same way backwards: turn à and ¤ back into the bytes C3 A4 and read them as UTF-8. That only works where the bytes form valid UTF-8, so correct text such as café or SÃO PAULO stays as it is.
The CSV is fine, Excel reads it wrong
Most exports from databases, shops and CRMs are UTF-8. Excel opens a CSV file without a byte order mark as Windows-1252, so Müller shows up as Müller. Your data is not broken. Two ways out:
- Add a BOM. Open the file in the Fix a file tab and download it as “UTF-8 with BOM”. Excel then opens it correctly with a double click.
- Import instead of opening. In Excel choose Data › From Text/CSV, set File origin to “65001: Unicode (UTF-8)” and load.
If the characters are already broken inside the file (you see ä in a text editor too), the file tab repairs them as well.
The same repair in your database and code
Each example turns Müller back into Müller.
-- Look first: which rows are garbled, and what would they become?
SELECT name,
CONVERT(CAST(CONVERT(name USING latin1) AS BINARY) USING utf8mb4) AS fixed
FROM customers
WHERE name LIKE '%Ã%' OR name LIKE '%â€%';
-- Then repair only those rows (make a backup first)
UPDATE customers
SET name = CONVERT(CAST(CONVERT(name USING latin1) AS BINARY) USING utf8mb4)
WHERE name LIKE '%Ã%' OR name LIKE '%â€%';MySQL’s “latin1” is really Windows-1252, so this also fixes € and curly quotes. Run it only on garbled rows: correct text with characters outside Windows-1252 would turn into “?”.
# Dump with the character set of the data, not the server default mysqldump --default-character-set=utf8mb4 shop > shop.sql # PostgreSQL: export as UTF-8 psql -d shop -c "\copy customers TO 'customers.csv' WITH (FORMAT csv, HEADER, ENCODING 'UTF8')"
Use utf8mb4, not utf8: MySQL’s old utf8 has only 3 bytes per character and turns emoji into “????”.
<?php $broken = "Müller"; echo mb_convert_encoding($broken, "Windows-1252", "UTF-8"); // Müller
This turns the characters back into Windows-1252 bytes, which are the original UTF-8. Run it once per layer of garbling.
broken = "Müller"
print(broken.encode("cp1252").decode("utf-8")) # Müller
# Mixed or twice-garbled text: pip install ftfy
import ftfy
print(ftfy.fix_encoding(broken)) # Müllerconst broken = "Müller";
console.log(Buffer.from(broken, "latin1").toString("utf8")); // MüllerNode’s “latin1” only covers characters up to U+00FF. For € or curly quotes (’) paste the text into the tool above instead.
# Same trick for a whole file iconv -f UTF-8 -t WINDOWS-1252 broken.txt > fixed.txt # Which encoding does a file have? file -i export.csv
What can’t be repaired
When a program could not convert a character, it often wrote ? or the replacement character � instead. The original byte is gone. Look for an older backup or the source system.
MySQL’s utf8 stores at most three bytes per character. Emoji need four and are lost. Switch columns and connections to utf8mb4 so it does not happen again.
Two or three broken characters without context can sometimes be read more than one way. Check the result, and use the buttons above the result to undo a step.
Questions about garbled text
What is mojibake?
Mojibake (Japanese for “character transformation”) is garbled text like ä instead of ä or ’ instead of ’. It happens when text saved in one character encoding is read with another, most often UTF-8 read as Windows-1252.
Why does ä turn into ä?
In UTF-8, ä is stored as two bytes, C3 A4. A program that reads them as Windows-1252 or Latin-1 shows one character per byte: C3 is à and A4 is ¤. The full explanation, step by step.
Can garbled text always be fixed?
Usually yes, as long as every byte is still there. If characters were replaced by ? or � along the way, that information is gone. The tool tells you how many characters are lost.
Why does my CSV look broken in Excel but fine in a text editor?
The file is fine. Excel opens CSV files without a byte order mark (BOM) as Windows-1252, so UTF-8 umlauts turn into ä. Save the file as “UTF-8 with BOM” in the Fix a file tab, or import it in Excel via Data › From Text/CSV and choose “65001: Unicode (UTF-8)”.
What is a BOM?
A byte order mark is an invisible character at the very start of a file (EF BB BF in UTF-8). It tells programs such as Excel that the file is UTF-8. Read with the wrong encoding it shows up as , often in front of the first column name.
What does  mean in my text?
A stray  in front of a symbol (°, ©,  ) is the first byte of a two-byte UTF-8 character read as Windows-1252. Fixing the encoding removes it.
Is my text uploaded?
No. The tool runs in your browser. Text you paste and files you open are processed on your device and never sent anywhere.