Text Encoding Converter
Fix mojibake and convert text files between Big5, UTF-8, GBK, Shift_JIS and other encodings, with automatic encoding detection.
How to use
- For garbled text, choose “Fix garbled text” and paste it. The tool re-reads it every likely way, puts the best reading first, and you click “Copy” to take it.
- To convert a whole file, choose “Convert a file” and drop the file in (or paste text).
- The source encoding is detected automatically and previewed. If the preview is still garbled, choose the source encoding yourself.
- Pick the output encoding, add a BOM if needed, and choose what happens to characters the output encoding cannot represent.
- Check the list of unconvertible characters, then click “Download” to save the converted file.
FAQ
Are my files uploaded?
No. Decoding, detection and conversion all happen in your browser. File contents never leave your device.
How is the encoding detected?
In order: a byte order mark at the start decides; a zero in every other byte means UTF-16; plain ASCII reads the same in every encoding; valid UTF-8 is taken as UTF-8 (text in other encodings almost never happens to follow UTF-8’s rules). Otherwise the file is read as Big5, GBK, Shift_JIS and the rest. Encodings that hit invalid bytes are ruled out first, then the readings are compared: common Chinese characters, kana, Hangul and full-width punctuation suggest real text, while rare ideographs, private-use characters and control codes suggest mojibake. It is a guess and can be wrong for short text, so trust the preview.
What causes mojibake, and can it always be fixed?
Mojibake appears when text is read with the wrong encoding, for example a UTF-8 file opened as Big5. If no bytes were lost along the way, the mistake can be reversed. If the text already shows � or many question marks, the original bytes were thrown away in an earlier conversion and only part of it can be recovered; find the original file and read it again.
Why can’t some characters be converted to Big5?
Big5 has about 13,000 Chinese characters. Rare characters such as “𠮷”, Simplified Chinese, emoji and many symbols have no Big5 code. The tool lists where they are, and you can replace them with ?, write them as &#number; references (which web pages display correctly) or leave them out. Use UTF-8 to keep every character.
Are characters like 許, 功 and 蓋 a problem?
Their second Big5 byte is 0x5C, the backslash, which older programs mistake for an escape character. This tool follows the WHATWG Encoding Standard and reads and writes them correctly, but other programs that handle Big5 files may still trip over them.
When do I need a BOM?
A BOM is a few bytes at the start of a file that announce its encoding. Excel needs one to show non-English text in UTF-8 CSV files correctly, but some programs (Unix scripts, some web server setups) break on it. When in doubt, add a BOM to CSV files meant for Excel and leave it off everything else.
Related tools
Traditional/Simplified Chinese
Convert between Simplified and Traditional Chinese, with optional Taiwan phrases (软件 → 軟體) and Hong Kong variants.CSV Viewer
View CSV and TSV files as a sortable, filterable table, with delimiter and Big5 detection. Files never leave your device.Text to Hex
Convert text to UTF-8 bytes in hex or decode hex back to text, with strict UTF-8 validation that points at the bad byte.Unicode Escape
Convert text to \uXXXX, \u{…}, &#x…;, U+XXXX and other escapes or back, with each character’s code point and UTF-8 bytes.