Text Encoding Converter

Detect a text file's encoding, BOM and line endings, and convert it between UTF-8, UTF-16, Shift_JIS, EUC-JP and JIS. Also shows bytes and fixes mojibake. Handy for Shift_JIS CSV files from Excel and other Japanese text. Files are processed in your browser and never uploaded.

About this tool

What does the Text Encoding Converter do?

A text file is just bytes; the character encoding decides how those bytes become letters. When a file is opened with the wrong encoding, Japanese text turns into garbage such as 縺薙s縺ォ縺。縺ッ (mojibake). This tool detects how a file is encoded, lets you correct the guess, and saves it again in the encoding you need. It also shows the byte representation of any text and tries to restore text that is already garbled.

How to use

Convert a file (File tab)

  1. Drop a text file onto the drop area, or click it to choose a file.
  2. Check Detected encoding, BOM, Line endings and the Preview.
  3. If the preview is garbled, pick the correct encoding in Read as.
  4. Choose the Output encoding and, if needed, Line endings (Keep, LF or CRLF).
  5. Click Download to save the converted file under the same name.

Inspect bytes (Bytes tab)

Type text into Text to see its bytes in hex for UTF-8, UTF-16LE, UTF-16BE, Shift_JIS, EUC-JP and JIS, with a copy button for each. A Per character table lists the code point and the UTF-8, UTF-16, Shift_JIS and EUC-JP codes of each character (first 200 characters).

Restore garbled text (Fix mojibake tab)

Paste text into Garbled text. The tool re-encodes it with the encoding it was probably misread as (Shift_JIS, EUC-JP, UTF-8 or Windows-1252) and decodes the bytes again, then lists the readable candidates, best first. Each candidate shows which mistake it assumes, for example "UTF-8 that was read as Shift_JIS".

Supported encodings

Encodings
Detection / Read asUTF-8, UTF-16LE, UTF-16BE, Shift_JIS (CP932), EUC-JP, JIS (ISO-2022-JP), ASCII
OutputUTF-8, UTF-8 with BOM, UTF-16LE with BOM, UTF-16LE, UTF-16BE, Shift_JIS (CP932), EUC-JP, JIS (ISO-2022-JP)

Features

  • Automatic detection of encoding, BOM and line endings (CRLF, LF, CR or mixed, with counts)
  • Warning when invalid byte sequences were replaced with �, a sign the file is in another encoding
  • Line ending conversion to LF or CRLF while converting
  • List of characters the output encoding cannot represent (for example emoji in Shift_JIS), with code point and first line; they are saved as ?
  • Shift_JIS is handled as Windows code page 932, including NEC and IBM extended characters such as ① and 髙

FAQ

Are my files uploaded?

No. Files are read and converted in your browser. Only the selected tab, output settings and the text typed in the Bytes and Fix mojibake tabs are saved in this browser; loaded files are not kept.

How do I make a CSV that opens correctly in Excel?

Excel on Japanese Windows opens CSV files without a BOM as Shift_JIS. Convert the file to UTF-8 with BOM (or to Shift_JIS) and Japanese text will display correctly.

The detected encoding is wrong. What can I do?

Detection is a guess based on the bytes and can be wrong for short files. Choose the right encoding in Read as and check the preview before downloading.

Can every garbled text be restored?

Only if no bytes were lost. If the garbled text already contains ? or �, those characters cannot be recovered, and the candidate shows how many characters could not be restored.