← All tools

Encoding fixer

Fix garbled text and broken characters: turn é, ’ and ال back into é, ’ and real Arabic or Urdu, find which encoding an old file was saved in, remove invisible characters and save it as clean UTF-8 (with a BOM for Excel if you like). Works for CSV, TXT, subtitles and code. Nothing is uploaded.

Enjoying Text encoding fixer?Your review and ideas shape what we build next.

Review Text encoding fixer

Please don't include file contents or passwords.

About the Text encoding fixer

Repair text where letters have turned into junk such as é, ’, ü or ال, find out which encoding an old file was really saved in, and save a clean UTF-8 copy. The fixer ranks every common encoding for your file and shows a sample of each, so you can pick the one where the words look right. It then repairs text that was garbled once or even twice, removes invisible characters and odd spaces, combines accents, can simplify smart quotes, converts line endings, and saves the result as UTF-8, UTF-8 with a BOM for Excel, UTF-16 or Windows-1252. It works for CSV, TXT, subtitles (SRT, VTT), HTML, JSON and code.

How to use it

  1. Drop the text, CSV or subtitle file, or paste the garbled text and press Fix pasted text.
  2. Check Read the file as: the best guess is first, with a sample of each encoding. Pick another if the words look wrong.
  3. Keep Repair garbled text on, and choose the other clean-ups you want.
  4. Compare the fixed text with the original.
  5. Choose Save as (UTF-8 for most uses, UTF-8 with BOM for Excel) and download the fixed file.

Tip: Always fix a copy of the original file, not a version that has been opened and saved again by another program. Each save in the wrong encoding can lose letters for good.

Why text turns into é and ’

Computers store letters as numbers, and an encoding is the table that says which number is which letter. UTF-8, the encoding of the modern web, stores English letters in one byte and other letters in two to four bytes: é is the two bytes C3 A9. Older Western software reads files as Windows-1252, where each byte is one character, so those two bytes appear as the two characters à and ©. That's mojibake, a Japanese word for garbled characters.

The same mistake explains the other common patterns: ’ was a curly apostrophe (’), “ and †were curly quotes,  before a space was a non-breaking space, and ال was Arabic or Urdu text. If garbled text is saved and opened wrongly again, it gets worse, for example é. The fixer undoes this one step at a time, up to three times, and only changes sequences that are valid UTF-8, so letters that are already correct are never touched.

Finding a file's real encoding

Files don't record their encoding, apart from an optional byte-order mark at the start, so it has to be worked out. The fixer decodes your file with each supported encoding, including UTF-8, UTF-16, Windows-1252 (Western Europe), Windows-1256 (Arabic and Urdu), Windows-1251 (Cyrillic), Windows-1250, Greek, Turkish, Shift_JIS, GBK, Big5 and EUC-KR. It scores each result: undecodable bytes, control characters, garbled sequences and words that mix alphabets count against it, and a file that is valid UTF-8 almost always is UTF-8. The samples show the first non-English text in each, which makes the right answer easy to see.

Characters that can't be recovered

Sometimes letters have already been replaced with the replacement character � or with question marks. This happens when a program read bytes it didn't understand and threw them away. The fixer tells you how many there are, but the original letters are gone from that file. Try reading it with a different encoding, which sometimes shows the text was fine all along, or go back to an earlier copy, an export from the original system or the sender's file.

Which encoding to save as

UTF-8
The standard for the web, databases, code and almost every modern program. Holds every language and emoji.
UTF-8 with BOM
The same, with three marker bytes at the start. Excel needs them to open a CSV with accents or non-Latin text correctly when you double-click it.
UTF-16 LE
What Excel calls Unicode Text, and what some Windows programs expect.
Windows-1252
Only for old Western software that can't read UTF-8. Characters it can't hold, such as Arabic or emoji, become question marks, and the tool tells you how many.

Other clean-ups

Invisible characters (zero-width spaces, soft hyphens and stray byte-order marks) and non-breaking spaces copied from web pages make words look identical while comparing differently, so search and duplicate checks fail. Combine accents turns a letter followed by a separate accent mark into the single accented letter (Unicode NFC), which fixes search and sorting for text from Macs and PDFs. Smart quotes to plain is for systems that accept only basic ASCII, and line endings can be set to Windows (CRLF) or Unix (LF).

Tips and tricks

Excel CSVs

If a CSV looks fine in a text editor but garbled in Excel, save it as UTF-8 with BOM.

Subtitles

Garbled accents in SRT subtitles are usually Windows-1252 or Windows-1256; pick the encoding whose sample reads correctly and save as UTF-8.

Check the samples

Short files with few accents can fool any detector. Read the sample lines rather than trusting the first guess blindly.

Then clean

For spreadsheets, take the fixed file to the CSV cleaner to tidy spaces, headers and columns.

Questions

How do I fix é and ’ in my text?

Paste the text or open the file here with Repair garbled text on. é becomes é, ’ becomes ’ and other garbled sequences are repaired.

What encoding is my file?

The fixer ranks the likely encodings and shows a sample of each; the best guess is marked.

Will it damage text that is already correct?

No. Only sequences that are valid garbled UTF-8 are changed.

Can it fix Arabic or Urdu text?

Yes. Garbled UTF-8 like ال is repaired, and old files saved in Windows-1256 can be read and saved again as UTF-8.

Why does my CSV look wrong only in Excel?

Excel guesses the encoding when you double-click a CSV. Saving as UTF-8 with BOM tells it the file is UTF-8.

Is my file uploaded?

No. Files are opened and processed in your browser, on your device. Nothing is uploaded, stored or logged, so the tools are safe for private and work files.

Related tools

Updated