How to fix mojibake when UTF-8 text turns into gibberish
By TechCompare · Updated · How we check
Mojibake is always caused by a mismatch between the encoding used to write bytes and the encoding used to read them. Fix it by identifying both encodings and reinterpreting correctly. Prevent it by using UTF-8 everywhere and declaring it explicitly.
UTF-8 characters read as Windows-1252
Every byte turns into its own character, so a lot of Ã, Â and â in your text points to this mix-up. Select the garbled form to fix it in the Encoding Converter.
Mojibake (Japanese for 'character transformation') is the garbled text you see when bytes written in one encoding are read as another. The classic case is UTF-8 read as Windows-1252, which is what browsers use for anything labeled Latin-1: é turns into é and it’s turns into it’s. The bytes are intact. The reader is just using the wrong encoding, so fixing it means knowing what encoding the text was written in and what encoding it's being read as.
How this is calculated
Common mojibake scenarios: a MySQL database column was created as latin1 but the application writes UTF-8 bytes into it, a CSV file exported from Excel doesn't include a BOM and is opened as ASCII, or an API response declares charset=ISO-8859-1 but actually returns UTF-8.
Recovery depends on whether the bytes were transcoded or just mislabeled. If they were only mislabeled, reopen them with the correct encoding and nothing is lost. If the garbled text was saved again, every save adds a layer. Café was garbled twice, so it takes two rounds to get back to Café. The Encoding Converter's Fix garbled text mode shows the bytes of every layer.
Copying garbled text can lose a byte. A closing ” is E2 80 9D in UTF-8, and Windows-1252 shows its last byte as an invisible control character. Copy and paste often drops it and leaves †on its own.
Prevention is simpler than recovery: always declare UTF-8 explicitly, file formats included.
Verdict
Prevent mojibake by declaring UTF-8 in HTTP headers, meta tags, and schema definitions. To fix existing gibberish, reinterpret mislabeled bytes with the right encoding, and reverse double-encoded ones one layer at a time. Most cases come from a latin1 MySQL column receiving UTF-8 bytes, an Excel CSV exported without a BOM, or an API header lying about its charset.
More Encoding scenarios
Related guides
Frequently asked questions
What is mojibake and what causes it?
Why does my database show é instead of é?
How do I fix text that was double-encoded to UTF-8?
Why does a closing quote turn into †with nothing after it?
Related tools
JSON Formatter
Validate, format, and minify JSON. Browse it as a tree, run JSONPath queries, compare two documents, or validate against a JSON Schema.
Use toolUnix Timestamp
Convert between Unix timestamps and human-readable dates.
Use toolCron Generator
Visually build standard 5-part cron expressions or translate them into readable schedules.
Use tool