Text to Unicode Converter
Convert text into Unicode escape sequences and decode them back, with a choice of \uXXXX, U+XXXX, or HTML entity output. Handles Chinese, emoji, and other supplementary-plane characters.
FreeOnline Tool
Loading…
How to Use
- Enter the text you want to convert (any characters work, including Chinese and emoji).
- Click Text to Unicode to get the matching \uXXXX escape sequences.
- To decode, paste Unicode escape sequences and click Unicode to Text.
- Choose the output format you need: \uXXXX, U+XXXX, or HTML entities (&#x...;).
- Click Copy to grab the result.
Features
- Two-way conversion between plain text and Unicode escape sequences.
- Works with the Basic Multilingual Plane as well as supplementary-plane characters such as emoji and special symbols.
- Multiple output formats: \uXXXX, U+XXXX, and HTML entities.
- Converts as you type, so results appear immediately.
- Useful for encoding work in JSON strings, JavaScript source, and HTML documents.
Use Cases
Escaping non-ASCII text in JSON
Convert JSON strings that contain Chinese into \uXXXX form to sidestep encoding problems during cross-platform transfer.
Handling special characters in HTML
Turn special characters into HTML entities (&#x...;) so a browser does not mistake them for markup.
Internationalization debugging
Convert multilingual strings into Unicode sequences that can be dropped into code constants or configuration files.
Tracking down mojibake
Convert garbled text into code points and compare them with what you expected to pinpoint an encoding mismatch.
FAQ
What is the difference between \uXXXX and U+XXXX?
They refer to the same code point. \uXXXX is the string escape syntax used in programming languages such as JavaScript and Java, while U+XXXX is the official notation of the Unicode standard.
Can it convert emoji?
Yes. Emoji live in the supplementary planes, so the tool outputs them as \u{XXXXX} or as a surrogate pair such as \uD83D\uDE00.
Can I drop the \uXXXX output straight into JSON?
Yes. The JSON specification supports four-digit hexadecimal \uXXXX escapes, so pasting the output into a JSON string value is perfectly valid.
Does it handle multiple lines at once?
Yes. Paste several lines of text or several blocks of Unicode escapes and the tool processes every character and returns the complete result.