Text-encoding brute force (mojibake rescue)
Try a file's bytes against common text encodings to find the one that isn't garbled. Runs entirely on your device.
Runs on your device. The file is never uploaded.
Text-encoding brute force (mojibake rescue) decodes the raw bytes of a file with 11 encodings, from utf-8 and windows-1252 through to utf-16be, then ranks the results. Each character scores 1, each replacement character minus 10, each stray control minus 3, and strictly valid UTF-8 earns 1000. You get 200-character previews, not a converted file.
Questions
Does it fix my file or only tell me what is wrong?
It tells you. The output is a report: a first line reading Best guess followed by the winning encoding name, then one row per candidate showing the encoding, its score, and the first 200 characters decoded that way with newlines written out as backslash n. No converted file is produced. Once you know the encoding, use a text encoding converter to re-decode the file for real.
Which encodings does it try?
Eleven, in this order: utf-8, windows-1252, iso-8859-1, macintosh, koi8-r, shift_jis, euc-jp, gb18030, big5, utf-16le and utf-16be. Each one is attempted through the browser's own TextDecoder, and any label your runtime does not support is skipped rather than failing the run. Nothing outside that list is considered, so a rarer legacy encoding will not be found.
How does it pick a winner?
By scoring each decode. Every character scores plus one, every U+FFFD replacement character scores minus ten, and every stray control character scores minus three. On top of that, if the bytes are strictly valid UTF-8, the utf-8 candidate gets a bonus of 1000. That bonus exists because single-byte encodings turn one multi-byte UTF-8 character into several and would otherwise out-score the correct answer on raw character count.
Why does it read the raw bytes instead of text?
Because a mis-decoded file is the whole point. Most text tools here decode your file as UTF-8 before they start, which would bake in the mistake you are trying to undo. This one takes the bytes untouched and decodes them itself, once per candidate encoding, so the comparison is fair.
The best guess is wrong. What now?
Read the table rather than the top line. Every candidate is listed with its score and a preview, so you can pick the row where the preview reads as real words in the language you expect. The scoring is a heuristic over character classes, not language detection, and short files give it little to work with.
Is my garbled file uploaded to be analysed?
No. Every decode runs in a Web Worker in this tab using the TextDecoder your browser already ships. There is no service doing the guessing, no account and no network call, which is worth knowing given that mojibake usually turns up in exports of exactly the data you would not want to send anywhere.