Character set encoding and mojibake repair
Show the bytes of text in UTF-8, GBK, GB18030, Big5, Shift_JIS and more as hex, turn hex back into text, or repair mojibake from text read in the wrong character set.
Process locally
Files stay in this browser session. Closing or clearing releases them.
Add text
Type or paste the text to process
Adjust settings
Optional: Operation, Character set, Mojibake was read as and more
Run
Processes in this browser; cancel at any time
About this tool
See the bytes of text in GBK, UTF-8, Big5, Shift_JIS and other character sets as hex, turn hex back into text, or repair mojibake. Use it to check how Chinese text is stored in an API or a database, to track down problems from mixing GBK and UTF-8, or to turn garbled text like “䏿–‡” back into 中文.
It supports UTF-8, GBK, GB18030, Big5, Shift_JIS, EUC-JP, EUC-KR, UTF-16LE/BE, ISO-8859-1 and Windows-1252, and hex can be written continuous, space separated, with 0x prefixes, as \x escapes or as percent-encoding. Up to 1 MB of text is handled in your browser without being uploaded.
How to use it
- Type or paste text, hex or mojibake, or select Use example.
- Choose an “Operation”: “Text to hex bytes”, “Hex bytes to text” or “Repair mojibake”. Then pick the “Character set” (GBK by default); for a repair, this is the correct one.
- For a repair, choose what the text was wrongly read as under “Mojibake was read as”. For hex output, pick a “Hex style” and whether to use “Uppercase hex”.
- Select Run, then preview the result and download it as a text file.
Formats and limits
- Input
- Text
- Output
- Plain text
- Size limit
- 1 MB
- Settings
- Operation (Text to hex bytes, Hex bytes to text, Repair mojibake); Character set; Mojibake was read as (Windows-1252, ISO-8859-1, GBK, Big5, Shift_JIS, EUC-KR); Hex style (Continuous, Space separated, 0x prefix, \x escapes, Percent); Uppercase hex
- Privacy
- Files stay in the current browser session. No file bytes are uploaded.
- Price
- Free, no sign-up
Common questions
Why does the same character have different bytes in GBK and UTF-8?
They are different encodings: 中文 is D6 D0 CE C4, four bytes, in GBK, and E4 B8 AD E6 96 87, six bytes, in UTF-8. Reading bytes with the wrong character set is what produces mojibake.
How do I repair text like “䏿–‡”?
That is UTF-8 text read as Windows-1252. Choose “Repair mojibake”, set “Character set” to UTF-8 and “Mojibake was read as” to Windows-1252, and the result is 中文 again. For other cases, pick the two character sets that match how the mojibake came about.
Can 锟斤拷 or � be repaired?
Usually not. � is the replacement character left when decoding fails, and 锟斤拷 is a run of � read as GBK. The original bytes were lost at the first mistake, so a repair only gives �.
Which hex formats can be turned back into text?
Hex can be continuous or separated by spaces, commas, colons or dashes, and 0x, \x and % prefixes are recognized. Bytes that are not valid in the chosen character set show as �, a sign to try another character set.
Why does it say a character cannot be encoded?
The chosen character set has no such character; GBK and Big5, for example, cannot hold emoji. The error names the character and its position, so switch to UTF-8 or GB18030. During a repair, it usually means “Mojibake was read as” is set wrong.
Related tools
Base16/32/58/64/85/91 encoding
Encode or decode Base16, Base32, Base58, Base62, Base64, Ascii85, Z85 and basE91, choosing the character set of the text, or hex for raw bytes.
Unicode, HTML, URL and Punycode escapes
Convert text to and from \u escapes, HTML numeric entities, percent-encoding in any character set (such as GBK URLs), Quoted-Printable and Punycode domains.
Encode and decode text
Encode or decode Base64, Base64URL, URL, hexadecimal or HTML entities. Encoding is not encryption.
Base64 to image or file
Turn Base64 or a data: URI back into a file such as an image; the type comes from the content or the URI.
Byte radix and endianness converter
Convert bytes between hex, binary, octal, unsigned or signed decimal, Base64 and UTF-8 text, and swap byte order between big and little endian in 2, 4 or 8-byte words.
Image or file to Base64
Encode images or any other file as Base64 or as a data: URI to paste into HTML, CSS or JSON.