Text Encoding Detector & Converter

Detect the character encoding of text or a file, fix garbled mojibake text, and convert between UTF-8, UTF-16 and Windows-1252.

Helpful?
Any file type. The file never leaves your browser. Previews are capped at 1 MB.
Mojibake fixer

Fix it re-reads each character as a Windows-1252 byte and decodes the bytes as UTF-8 (falls back to Latin-1). Garble does the reverse so you can reproduce the problem.

Detection result
Detected encoding:
Paste text or upload a file, then press Detect.
0
bytes
0
characters
source


                
Convert & download

Re-encodes the decoded text (or your pasted text) and downloads it. Characters that do not exist in the target encoding are replaced with ?.

Seeing Café where you expected Café, or ’ instead of an apostrophe? That is mojibake: text written in one encoding and read in another. This tool works out which encoding a file or snippet actually uses, repairs the garbled text, and lets you re-save it in the encoding you need — without uploading anything.

What it detects

  • Byte-order marks for UTF-8, UTF-16 LE/BE and UTF-32.
  • UTF-8 by validating the multi-byte sequences (and plain ASCII, which is also valid UTF-8).
  • UTF-16 without a BOM, from the tell-tale alternating NUL bytes.
  • Windows-1252 versus ISO-8859-1, from bytes in the 0x80–0x9F range that only Windows-1252 assigns to printable characters.

How the mojibake fix works

Garbled text such as é is usually UTF-8 bytes (C3 A9) that were decoded as Windows-1252. The fixer reverses that mistake: it maps each character back to the byte it came from and decodes the bytes as UTF-8 again. Double-encoded text (fixed once, still wrong) can be run through the fixer twice.

Converting between encodings

Choose UTF-8 (with or without BOM), UTF-16 LE or BE, Windows-1252 or ISO-8859-1 and download the converted file. Characters that do not exist in the target encoding are replaced with ? and counted so you know what was lost. For the background, read our guide to ASCII, Unicode and UTF-8.

Frequently Asked Questions

Upload it here. The tool checks for a byte-order mark, validates it as UTF-8, looks for UTF-16 patterns and finally distinguishes Windows-1252 from ISO-8859-1. It reports the encoding with a confidence level and the evidence it used.

Garbled text produced when bytes are decoded with the wrong character encoding, for example UTF-8 bytes shown as Windows-1252: é appears as é, ü as ü and a curly apostrophe as ’.

Paste the text and press Fix. The tool converts each character back to the original UTF-8 bytes and decodes them correctly, restoring é and the apostrophe.

Yes for 8-bit encodings: a file with no bytes above 0x7F is indistinguishable across ASCII, UTF-8, Windows-1252 and ISO-8859-1 (they agree on those bytes), and Windows-1252 versus ISO-8859-1 is a judgement based on the 0x80–0x9F range. UTF-8 and UTF-16 detection is reliable.

No. The file is read by your browser with the File API and never leaves your device; detection, fixing and conversion all run locally.

Almost always. UTF-8 covers every language, is the web standard and is backwards compatible with ASCII. Only add a BOM if a Windows tool such as Excel needs it to recognise the encoding.
Share this tool