b2KIT

File Encoding Detector

Detect the character encoding of text files (UTF-8, Latin-1, Shift-JIS, etc.) with confidence scores.

Tested tool guide Tested browser tools Checked August 16, 2026

What File Encoding Detector does and how it behaves

When a text file displays replacement symbols, accented letters incorrectly, or unreadable Japanese text, File Encoding Detector examines the file's byte sequence and reports likely character encodings such as UTF-8, Latin-1, or Shift-JIS with confidence scores. The selected file and analysis remain in the browser. The main surprise is that encoding detection is not always definitive: short files, ASCII-only content, and byte sequences valid under several encodings may produce multiple plausible candidates.

How the result is produced

1

Byte-level evidence

Encoding belongs to the stored bytes, so the detector works from the selected file rather than from text already decoded by an editor. Explicit signatures, such as a byte order mark, can provide strong evidence. Without a signature, recurring byte patterns and whether sequences are valid under candidate character sets help distinguish likely interpretations.

2

Ranked candidates

The result pairs candidate encoding names with confidence scores. A higher score means the file's bytes fit that candidate better according to the available evidence; it does not prove which encoding the author intended. Comparing the leading candidates is especially important when their scores are close or the file contains little non-ASCII text.

Good uses

  • Check the encoding of a CSV or source file before importing it into software that asks for a charset.
  • Investigate mojibake after accented names, currency symbols, or Japanese characters open incorrectly in a text editor.
  • Audit a collection of legacy text files before converting them to UTF-8, using the reported candidate as a starting point.

Limits and checks

  • An ASCII-only file cannot reveal whether its author intended ASCII, UTF-8, or another ASCII-compatible encoding because the relevant byte values overlap.
  • A high confidence score describes evidence in the bytes, not certainty. A short sample or repetitive content can support the wrong legacy encoding.
  • Detection does not repair damaged text. If bytes were already decoded incorrectly and saved again, the reported encoding may describe the newly saved bytes rather than the original document.

Common questions

Can it always distinguish UTF-8 from Latin-1?

No. UTF-8 has strict multibyte sequence rules, so many files containing non-ASCII characters can be distinguished from Latin-1. However, plain ASCII bytes are valid UTF-8 and also have interpretations in Latin-1 and other compatible encodings. With only overlapping bytes, no detector can recover an author's unstated intent from the file alone.

Does detecting an encoding convert or fix the file?

No. The result identifies probable ways to interpret the existing bytes and supplies confidence scores. It does not rewrite the file, normalize characters, or reverse mojibake. Use the result when choosing an input encoding in an editor or converter, then inspect non-ASCII characters before saving a converted copy.

References and verification

The behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools