Text File Encoding Detector – Identify Character Encoding of Your Files

Upload a text file or paste text to detect its character encoding (UTF-8, UTF-16, ASCII, Windows-1251, ISO-8859-1, and more).

What is Text File Encoding Detector?

This tool analyzes text files or pasted text to identify the character encoding used. Character encoding defines how bytes are mapped to characters (letters, numbers, symbols). Common encodings include UTF-8, UTF-16, ASCII, Windows-1251 (Cyrillic), and ISO-8859-1 (Latin).

How it works in theory: The detector examines the byte sequence of your input. It looks for Byte Order Marks (BOM) that indicate UTF-8, UTF-16, or UTF-32. It checks for null bytes (common in UTF-16/32). It validates UTF-8 byte sequences according to the UTF-8 specification. If all bytes are in the 0-127 range, it's ASCII. If bytes are in the 128-255 range and don't form valid UTF-8, the encoding is likely a single-byte code page like Windows-1251 or ISO-8859-1. The tool provides a hex preview for technical verification.

This helps developers, translators, and data analysts identify encoding issues that cause garbled text (mojibake).

How to use:

  1. Option 1: Click “Choose File” and select a text file (.txt, .csv, .json, .xml, .html, .css, .js, .py, .log, etc.).
  2. Option 2: Paste text directly into the text area.
  3. Click the “Detect Encoding” button.
  4. View the results: file size, detected encoding(s), and a hexadecimal preview of the first 200 bytes.
  5. Use the “Clear” button to reset all fields.

Tips: The tool may detect multiple possible encodings. If you see “UTF-8 with BOM” or “UTF-8 (no BOM)”, the file is likely UTF-8. If you see “Windows-1251 / ISO-8859-1 / Other”, the file uses a single-byte encoding common for Western or Cyrillic languages.

Leave a Reply