Text encoding detector

Upload a text file to estimate its likely encoding (ASCII, UTF-8, UTF-16 or Latin-1/Windows-1252).

Example:

How it works

A text file that displays strange characters ("é" instead of "é") often suffers from an encoding problem that the software opening it didn't detect correctly. This tool analyzes the raw bytes of the file: if they form a valid UTF-8 sequence, it identifies it (ASCII if all bytes are below 128, UTF-8 otherwise); if not, it checks for a UTF-16 BOM, and as a last resort assumes Latin-1/Windows-1252, a single-byte encoding where any sequence of bytes is technically valid.

Why is the confidence sometimes "low"?

Unlike UTF-8 (which has a verifiable internal structure) or UTF-16 (identifiable by its BOM), the Latin-1/Windows-1252 encoding has no signature: any sequence of bytes is valid in it. When no other encoding matches, the tool suggests Latin-1 by default, but with low confidence because it is only a reasonable guess.

Why is a UTF-8 file sometimes detected as ASCII?

ASCII is a strict subset of UTF-8: if all bytes in the file are below 128 (0x80), the file is valid as both ASCII and UTF-8. The tool then displays "ASCII" because it is the most restrictive and most universally compatible encoding that correctly describes the file.

100% local processing: the analysis runs entirely in your browser via WebAssembly, and your file never leaves your device.