Skip to content

Text Encoding Detector

Detect file encoding, preview text and convert to UTF-8. Fix garbled text and mojibake instantly. Free and private.

  • 100% free
  • No Signup
  • Never saved
Your Privacy Matters

Detection and conversion run entirely inside your browser. Your files and text are never uploaded, sent to a server or stored.

ADVERTISEMENT
Demo Ad 728 x 90 320 x 100

Detect text encoding in 3 simple steps

  1. 1

    Add your file or text

    Drop a text file, or paste text that looks broken.

  2. 2

    Review the match

    See the best encoding, its likelihood and a live preview.

  3. 3

    Convert or repair

    Download clean UTF-8 or copy the repaired text.

TEXT ENCODING DETECTOR GUIDE

Text Encoding Detector – Detect File Encoding, Convert to UTF-8 and Fix Garbled Text Online

Does your text file show strange symbols such as é, ’ or question marks instead of normal letters? That is an encoding problem, and this free text encoding detector helps you solve it. Drop a text file and the tool finds the most likely character encoding, such as UTF-8, UTF-16, Windows-1252 or Windows-1256, shows how likely each match is, and lets you preview the file as any encoding. When the preview looks right, you can download the file as clean UTF-8, with an optional UTF-8 BOM that helps older versions of Excel. It also has a Fix garbled text mode that repairs mojibake, the broken text that appears when the wrong encoding was used.

Encoding problems are common with CSV exports, subtitle files, old documents, emails and web pages, especially for languages such as Urdu, Arabic, Russian, Hindi and accented European text. Guessing the right encoding by trial and error wastes a lot of time. This tool does the analysis for you and gives you evidence, including the byte order mark, line endings, whether the file is valid UTF-8 and the first bytes in a hex view. Detection and conversion run inside your browser, so your files are never uploaded, and files up to 50 MB can be handled.

Detect File Encoding

Find out whether a file is UTF-8, UTF-16, Windows-1252, Windows-1256, ISO-8859-1 and more, with a relative likelihood for each possible encoding.

Fix Garbled Text (Mojibake)

Paste text that shows characters like é or ’ and get repair suggestions that turn it back into readable text.

Convert to UTF-8

Preview the file in any encoding and download a clean UTF-8 copy, with an optional BOM for older Excel versions.

Byte Order Mark Check

See whether the file starts with a BOM, and learn which encoding it points to.

Urdu, Arabic and Cyrillic Text

Check scripts found in your text and rescue Urdu, Arabic and Russian text that shows as strange symbols.

Hex View of the First Bytes

Look at the raw bytes at the start of the file, where a BOM or a telltale pattern often shows up.

What Is Text Encoding?

Computers store text as numbers. A character encoding is the rulebook that says which number stands for which character. If a file was saved with one rulebook and opened with another, the numbers are read wrongly and you see broken characters. The most important encoding today is UTF-8, which can represent every character in every language and is the standard of the modern web. Older files often use encodings such as Windows-1252 for Western European languages or Windows-1256 for Arabic and Urdu.

A text file does not usually say which encoding it uses, so software has to guess. A text encoding detector looks at the bytes of the file and works out which encoding fits best, which is why detection gives a likelihood and not a guarantee.

How to Detect the Encoding of a Text File (Step by Step)

Finding the encoding of a file takes a few seconds with our free tool.

  1. Open the Detect file encoding tab: Drag and drop a text file, or click Select file. It accepts .txt, .csv, .html, .srt and any other text based file.
  2. Read the best match: See the most likely encoding with its relative likelihood, plus facts such as file name, size, BOM, valid UTF-8, ASCII only and line endings.
  3. Check the possible encodings: Select a different encoding in the list to preview the file as that encoding.
  4. Compare the preview: Switch Preview as until the text looks correct. Correct letters mean you found the right encoding.
  5. Download as UTF-8: Click Download as UTF-8, and add a BOM if the file will open in an older version of Excel.

If you only need to remove strange symbols from text that is already readable, the Special Character Remover may be the quicker choice.

Common Text Encodings Explained

Popular text encodings and where they are used
Encoding Covers Typical use
UTF-8 All languages and symbols Websites, apps, APIs, modern files
UTF-16 All languages, two or more bytes per character Windows files, some Excel exports
ASCII Basic English letters, digits and symbols Old systems and simple data files
Windows-1252 Western European languages Older Windows documents and CSV files
ISO-8859-1 Western European languages Old websites and email
Windows-1256 Arabic, Persian and Urdu Older Arabic and Urdu documents
Windows-1251 Russian and other Cyrillic languages Older Russian files
Shift_JIS, GBK, Big5 Japanese, Simplified Chinese, Traditional Chinese Older East Asian files

Why Does My Text Show é, ’ or Question Marks?

These patterns are the typical signs of mojibake, and each one points to a likely cause.

Common garbled patterns and likely causes
What you see What it usually means Likely fix
é instead of é UTF-8 text was read as Windows-1252 Open or repair it as UTF-8
’ or “ Curly quotes saved in UTF-8 but read as Windows-1252 Repair the text or open the file as UTF-8
Question marks or boxes Characters were lost or the font cannot show them Check the source file and convert to UTF-8
مرحبا style text Arabic or Urdu UTF-8 read as a single byte encoding Repair as UTF-8 or preview as UTF-8
Cyrillic letters like пр Russian UTF-8 read as Windows-1252 Preview and convert using UTF-8
Spaces between every letter UTF-16 text read as a single byte encoding Preview as UTF-16

How to Convert a File to UTF-8

First detect the encoding and make sure the preview looks correct. Then click Download as UTF-8. The tool decodes the file with the encoding you selected and saves it as UTF-8, which is the safest choice for websites, databases, apps and sharing. Turn on Add UTF-8 BOM only when you need to open the file in an older version of Excel, because that program uses the BOM to recognize UTF-8. Most other programs do not need it.

How to Fix Garbled Text (Mojibake)

Switch to the Fix garbled text tab and paste the broken text. The tool shows repair suggestions and statistics such as characters, non-ASCII characters, replacement characters and invisible characters, plus the scripts found in your text. If a suggestion looks right, copy it. Mojibake can often be reversed only when no characters were lost. If the file already contains replacement characters, the original information may be gone and you need the source file again.

Can Encoding Detection Be 100% Accurate?

No. Detection is a smart guess based on byte patterns. Pure ASCII text is valid in many encodings, short files give little evidence, and some single byte encodings look very similar. That is why the tool shows a relative likelihood and a list of other possible encodings with a live preview. The best test is your own eyes: the correct encoding makes the text readable in its language.

Who Uses a Text Encoding Detector?

  • Web and software developers: Fix broken characters in files, databases, logs and API responses.
  • SEO and content teams: Repair imported content, CSV files and exported product data.
  • Data and spreadsheet users: Open CSV files with accents or Urdu and Arabic names correctly.
  • Translators and subtitle editors: Fix .srt and text files that show strange characters.
  • Students and researchers: Recover old documents and text files in other languages.

Tips to Avoid Encoding Problems

  • Use UTF-8 everywhere: Save files, databases and web pages as UTF-8 whenever you can.
  • Declare the encoding: Add the UTF-8 meta tag to web pages and set the encoding when you export a CSV.
  • Use a BOM only for old Excel: Many tools do not need it, and it can show as a stray character in some programs.
  • Keep the original file: Always keep the source file before you convert or repair it.
  • Check a few special characters: After converting, check accented letters, quotes and non-English text.

Is It Safe to Use This Tool with My Files?

Yes. Detection and conversion run entirely inside your browser, so your files and text are never uploaded, sent to a server or stored. Files up to 50 MB can be handled on your device. As a general habit with any online tool, be careful with files that contain passwords or very sensitive information.

More Free Text Tools You May Need

This tool is often one step in a bigger text workflow. These related free tools help with the rest of the job:

Free Text Encoding Detector: Fast, Private and Easy to Use

Our text encoding detector was built to take the guesswork out of broken text. You get a likely encoding, evidence from the file, a live preview, a clean UTF-8 download and a repair tool for mojibake, all without signup or uploads.

Ready to try it? Scroll back up, drop your file or paste your garbled text and see the result.

ADVERTISEMENT
Demo Ad 300 x 250 300 x 250
COMMON QUESTIONS

Text Encoding Detector FAQ

Quick answers about finding the encoding of a file, fixing garbled text, converting to UTF-8 and how accurate detection can be.

How do I find the encoding of a text file?

Drop the file into the detector. The tool checks for a byte order mark, tests whether the bytes are valid UTF-8, looks for UTF-16 patterns and scores common legacy encodings. It shows the best match with a relative likelihood and lets you preview the file in any candidate encoding to confirm the answer by eye.

Why does my text show characters like é, ’ or question marks?

This is mojibake, caused by reading text with a different encoding than the one used to write it. Characters like é usually mean UTF-8 text was read as Windows-1252. Question marks or black diamonds can mean the original characters were lost or replaced. Use the "Fix garbled text" tab to try to reverse the wrong step.

What is the difference between UTF-8, UTF-16 and Windows-1252?

UTF-8 and UTF-16 can both store every Unicode character, but UTF-8 uses one to four bytes and is the standard on the web, while UTF-16 uses two or four bytes. Windows-1252 is an older single byte encoding for Western European languages that can store only 256 characters. Only the Unicode encodings can mix many scripts in one file.

How do I convert a file to UTF-8?

Upload the file, select the encoding whose preview shows correct text, and click Download as UTF-8. Tick the BOM option if the file must open correctly in older versions of Excel. For code, JSON and shell scripts it is better to leave the BOM out.

Can encoding detection ever be 100% accurate?

Not always. A BOM or a valid multi byte UTF-8 sequence gives strong evidence, but many single byte encodings use the same bytes for different letters, and a short text can fit several of them. That is why the tool shows a ranked list and a live preview, so you can confirm the right encoding by checking that the text is readable.

Can it fix Arabic, Urdu or Russian text that shows as strange symbols?

Often, yes. If the file is a legacy Windows-1256 or Windows-1251 file, upload it, select that encoding in the preview and download the UTF-8 version. If you only have pasted text that was UTF-8 read as Windows-1252, the repair tab can usually restore it. If the text already became question marks, the original characters are gone and you need the source file.

Is it safe to upload my file, and is there a size limit?

Your file is never uploaded. It is read and analyzed inside your browser and disappears when you close the page. The tool accepts files up to 50 MB, and for very large files it analyzes the first part of the file for speed. As a general habit, avoid handling highly sensitive data on any website you do not fully trust.

ADVERTISEMENT
Demo Ad 728 x 90 320 x 100