How to Fix Mojibake and Corrupted Characters
Mojibake occurs when text encoded in modern UTF-8 is opened or saved using legacy single-byte encodings like Windows-1252, ISO-8859-1, or MacRoman. Our free web utility accurately reverses the misinterpretation without altering legitimately spelled international words. Follow these steps:
- Paste or Drop Your Garbled Text: Copy corrupted text directly from a file, database dump, email, or terminal into the left editor pane. You can also drag and drop a
.txtor.csvfile directly onto the card. - Automatic Real-Time Detection: The tool scans the text in real-time. Within milliseconds, it computes potential multi-pass encoding paths (Windows-1252, ISO-8859-15, CP1250, CP1251, MacRoman, CP437) and ranks the highest-probability repair.
- Verify the Repair Chain: Inspect the detected sequence pill (e.g. "UTF-8 was read as Windows-1252 (1 pass)") and toggle alternative matches from the Candidates strip if your content requires specific dialectical mappings.
- Highlight Changes: Turn on "Highlight changes" to inspect character-by-character replacements before copying your clean text or downloading an authentic UTF-8 file.
Before and After Examples
Notice how single-byte misreadings produce typical multi-character garbage sequences that our engine converts directly back into clean Unicode text:
The café’s menu had delicious crème brûlée.
Double corrupted: élève.
Cyrillic error: Привет, мир!
Thai: สวัสดี é
The café’s menu had delicious crème brûlée.
Double corrupted: élève.
Cyrillic error: Привет, мир!
Thai: สวัสดี é
Explanation: What Causes Mojibake and Why Does It Happen?
The word mojibake (文字化け) comes from Japanese, literally meaning "character transformation." In the early days of computing, different operating systems and regions devised their own character sets. Western Windows machines relied on Windows-1252 (or CP-1252), older Unix machines used ISO-8859-1, DOS systems ran CP437, and Apple computers used MacRoman. Each system assigned symbols to 8-bit bytes (values from 0 to 255).
The internet standardized on UTF-8, a variable-length encoding where common ASCII characters use one byte, while accented letters, non-Latin scripts (Cyrillic, Greek, Arabic, Indic, Thai, CJK), and emojis require two, three, or four bytes.
When a legacy text editor, misconfigured MySQL database connection (such as latin1 client charset connecting to a utf8mb4 table), or email server receives a multi-byte sequence like 0xC3 0xA9 (the UTF-8 representation of é) and treats each byte independently according to Windows-1252, byte 0xC3 prints as à and byte 0xA9 prints as ©.
Understanding Limitations: When Text Cannot Be Recovered
Mathematical reconstruction is only possible when the underlying byte patterns were preserved intact. In two scenarios, data cannot be recovered:
- Question Marks (
?): When an application fails to map an unknown byte into its local character set, it frequently discards the byte and writes an ASCII question mark (0x3F). Because every distinct character becomes?, entropy is destroyed and original information cannot be guessed mathematically. - Unicode Replacement Character (
/ U+FFFD): When an improper UTF-8 reader replaces invalid byte sequences with replacement glyphs, the genuine byte sequence is lost upon re-saving. Our engine transparently highlights these regions and repairs all salvageable surrounding text.
Frequently Asked Questions
What is mojibake?
à and punctuation into â€.
Why do I see ’ instead of an apostrophe?
0xE2 0x80 0x99. If software reads those bytes as single-byte Windows-1252, 0xE2 renders as â, 0x80 renders as €, and 0x99 renders as ™.
Can all garbled text be fixed?
? or replacement characters , those specific characters have lost their byte data permanently.
Is my text uploaded or sent to a server?
What is double mojibake and how does the tool fix it?
é) happens when an already corrupted string is re-saved as UTF-8 and then mistakenly read as Windows-1252 once more. Our tool offers a multi-pass reversal algorithm that recursively decodes up to 3 layers of corruption.
Will this tool damage correctly spelled words like "São Paulo"?
à characters in legitimate Portuguese or Vietnamese vocabulary are protected, and conversions are applied strictly when multi-byte grammar matches an authentic Unicode code point with an improved readability score.
Related Free Tools by MafLabs
Explore our suite of deterministic, private, client-side developer and text utilities: