Text Encoding Detector and Mojibake Fixer

Turn Café back into Café, fix Russian, Polish or Greek text that came out as nonsense, and find out which encoding a text file really uses.

Funziona nel tuo browser. I tuoi file non lasciano mai il dispositivo. Scopri come verificarlo

…

Come si usa

  1. 1
    Choose a task

    Repair text or detect a file.

  2. 2
    Paste or open

    Garbled text or a text file.

  3. 3
    Read the result

    The repair steps or the detected encoding.

  4. 4
    Compare previews

    For legacy encodings, check the ranked list.

  5. 5
    Pick another encoding

    If the top guess is wrong.

  6. 6
    Save as UTF-8

    Download the clean text.

Informazioni su questo strumento

Mojibake is the garbled text you get when bytes written in one character encoding are read with another: Café becomes Café, an apostrophe becomes ’ and a Russian greeting turns into a row of Ð and Ñ characters. It usually happens when UTF-8 text passes through a system that assumes Windows-1252 or ISO-8859-1, such as an old database connection, a CSV opened in the wrong program or an email client with a missing charset. Because single-byte code pages map every byte to some character, the damage is often reversible. This tool reverses it: it re-encodes the garbled text with each likely code page and decodes the bytes as UTF-8, keeping the result only when it reads more naturally, and repeats the process for text that was mangled twice. For files, it detects the encoding from byte-order marks, UTF-16 byte patterns and UTF-8 validity, ranks more than 20 legacy encodings by how natural their decoding looks, and lets you save the file as clean UTF-8.

Common mojibake patterns

- é è à ö: accented Latin letters, UTF-8 read as Windows-1252. - ’ “ – €: curly quotes, dashes and the euro sign. - Ð and Ñ followed by other characters: Cyrillic UTF-8 read as Windows-1252. - é: the same text damaged twice. - Question marks or black diamonds: the original bytes were replaced and cannot be recovered.

How detection works

A byte-order mark identifies UTF-8, UTF-16 and UTF-32 directly. Without one, alternating zero bytes reveal UTF-16. Valid multi-byte UTF-8 is almost never produced by accident, so a file that decodes cleanly as UTF-8 almost certainly is UTF-8. Otherwise each legacy encoding is tried and scored: one consistent script, normal capitalisation and no control characters score high, while words that mix alphabets or switch to capitals mid-word score low.

Preventing it

Declare UTF-8 everywhere: the HTTP Content-Type charset, the HTML meta charset, the database and connection character set (utf8mb4 in MySQL), and the encoding option when you read or write files in code. When Excel must open a CSV, save it as UTF-8 with a BOM.

Limits

Short texts and closely related code pages can be ambiguous: ISO-8859-1 and Windows-1252, or Greek and Cyrillic pages, may score the same. Check the preview and choose another encoding from the list if needed. Text whose bytes were already replaced by question marks cannot be repaired.

Esempio svolto

The pasted line Café crème, déjà vu – « l’été » is repaired in one step to Café crème, déjà vu – « l’été », and Привет, мир! becomes Привет, мир!, both identified as UTF-8 that had been read as Windows-1252.

In breve

Domande frequenti

What is mojibake?

Garbled text caused by decoding bytes with the wrong character encoding.

Can every garbled text be fixed?

No. If characters were replaced by question marks, the original bytes are gone.

Why does ’ become ’?

Its three UTF-8 bytes were read as three Windows-1252 characters.

How sure is the file detection?

Very sure for BOMs, UTF-16 and UTF-8; legacy encodings are ranked guesses with previews.

Can I convert the file to UTF-8?

Yes. Download the decoded text, saved as UTF-8.

Is my file uploaded?

No. It is read in your browser.

Completamente gratisNessun costo, nessuna registrazione
I file restano privatiTutto funziona nel tuo browser
Facile nella tua linguaDisponibile in molte lingue