Skip to content

Text encoding detect

Identify a text file's character encoding with an honest evidence hierarchy.

textencodingcharsetutf-8

Upload

Files (1–1)
One text file, up to 2 MB (any encoding).
Questions people ask
Why is a valid UTF-8 file "proven"?
Because the tool decodes the whole input under UTF-8 and it succeeds byte-exactly. That is a mathematical property of the bytes, not an opinion. The same holds for byte-order marks: the mark is recognised byte-exactly and the payload is decoded under its codec as confirmation. Everything else is inference, and the report labels it as such.
What is the confidence field then?
A class, not a percentage: proven (a byte-level proof over the whole file), likely (the detector's top candidate carries zero erroneous-character ratio and at least 0.75 language coherence), uncertain (everything else), binary-like (NUL bytes, no verdict) or empty. The percentages the report may show (chaos, coherence) are produced by the detection library over the sample; the tool never invents its own.
Can it identify every legacy codepage?
No tool can promise that from bytes alone: single-byte codepages overlap heavily (the same bytes are valid in several of them), and short samples without language-specific words cannot be told apart. Where the evidence is thin the tool says "uncertain" and lists the candidates. For a certain answer, use text-encoding-convert with the encoding declared explicitly; its strict decode is the proof.
What happens to a file that is actually binary?
NUL bytes mark binary-like content; the tool refuses to claim an encoding and reports the count instead. A wrong-but- plausible "it's Latin-1" verdict for a PNG would be worse than no verdict.