Skip to content
UniKit

Text file decoder

Read txt, source and SVG files in the browser with automatic UTF-8 / UTF-16 / GBK detection plus byte, character, line and BOM statistics.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

txt / md / json / csv / log / svg / source files — read in the browser only, never uploaded.

File content

Decoding happens locally — no upload request is ever made.

Choose a file to see the decoded content

What this tool does

  • Inspect a txt, log or config file without installing an editor and without uploading it anywhere.
  • Track down mojibake: the result shows the encoding actually used (UTF-8 / UTF-16LE / UTF-16BE / GBK), whether a BOM was present and how many replacement characters appeared.
  • Check file size metrics in one place: bytes, characters and lines, plus whether line breaks were normalised.

Example

Input

你好,UniKit
第二行

Output

你好,UniKit
第二行

Saved as UTF-8 and decoded again the text is unchanged; save it as GBK instead and the encoding line shows gbk.

Frequently asked questions

How is the encoding detected?

First the BOM (EF BB BF / FF FE / FE FF), then a UTF-16 guess based on where the NUL bytes sit, then a strict UTF-8 decode and finally a GBK fallback. Whatever happened is reported, so the tool never silently switches encodings.

Will GBK files still look broken?

GBK / GB2312 Chinese text decodes correctly (the bytes D6 D0 CE C4 are 中文 in GBK). But a UTF-8 file read as GBK, or a Big5 / Shift-JIS file, will still not match; pick the encoding manually or watch the replacement-character count.

What about binary files?

When NUL bytes appear in something that is not UTF-16 the tool shows a binary warning, because the result is probably unreadable. It does not dump hex and never writes the file back to disk.

Is the file uploaded or stored?

No. The browser File API turns it into a byte array that is decoded in the page: no network request, no local storage write, and everything disappears on refresh.

Keywords:text file decoderencoding detection

Related tools