Unicode Converter
Escape text as \uXXXX sequences or decode them back to readable characters, for JSON, JavaScript and Java.
Unicode escape sequences represent every character in the Unicode standard as a backslash, a "u", and four hex digits. They are the language-neutral way to transport text through systems that are picky about encodings - JSON files, JavaScript strings, Java properties and build scripts all accept them. This tool converts readable text into those sequences and back.
The escape direction maps each character to its \uXXXX form. Characters beyond the basic plane, such as emoji, are written as a pair of sequences covering their surrogate halves, which is exactly what the JSON and JavaScript parsers expect. The decode direction reverses the process and restores the original string.
All conversion happens in your browser. Paste a message, a snippet or a configuration value, convert it, and move on - no upload, no account, no trace left behind. This makes the tool comfortable for strings that carry personal or sensitive content.
Features
- Convert text to \uXXXX escape sequences, and sequences back to text.
- Correct handling of characters outside the basic multilingual plane via surrogate pairs.
- Output is valid inside JSON, JavaScript, Java and C-family string literals.
- Round-trips any input exactly, including emoji, accents and CJK.
- Instant conversion with no server involvement.
- Fully offline and private.
How to Use
- 1
Paste a string
Enter readable text, or an escaped string full of \uXXXX sequences that you want to inspect.
- 2
Pick the direction
Choose To Unicode to escape, or From Unicode to decode the sequences back into characters.
- 3
Convert
Press the button and read the result. Escaped output slots directly into a JSON or JavaScript literal.
- 4
Copy or download
Copy the converted value, or download it when the string is long enough to warrant a file.
Example
Text to escape sequences
café 你好↓
\u0063\u0061\u0066\u00e9 \u4f60\u597dSequences to text
😀 means laughing↓
😀 means laughingCommon Problems
Escaping with the wrong representation
Some tools emit \U0001F600 with eight digits or percent-encoded forms. JSON, JavaScript and Java only accept the four-digit \uXXXX form, with surrogate pairs for higher characters - which is exactly what this tool produces.
Splitting a surrogate pair
An emoji is one code point made of two UTF-16 halves. Escaping only one half corrupts the character. This tool writes both halves together so the pair survives a round trip through any parser.
Treating escapes as encryption
Unicode escapes are plain text with a different spelling. They hide characters from a quick glance but offer no security - an escaped secret is still a plaintext secret.
Mixing escape styles in one file
A file that mixes readable characters, \uXXXX and HTML entities is hard to read and easy to corrupt. Convert to a single consistent form before committing it.
Assuming escapes mean ASCII
An escape sequence still represents its original character - 你 is the character 你, not an ASCII string. Tools that claim to "convert to ASCII" by escaping are only relabeling the bytes.
Forgetting that JSON doubles the backslashes
When you paste \uXXXX escapes into a JSON file, the JSON parser needs a literal backslash, so the source must write the backslash itself escaped. The tool's output is the plain JavaScript-style form; the surrounding format decides whether extra escaping is required.
Technical Details
Each escape is a backslash, a lowercase u and four lowercase hex digits. A single character in the basic plane maps to one sequence; a character above U+FFFF maps to a high-surrogate and low-surrogate pair, matching how JSON and JavaScript store it.
The conversion is code-point based, so it works uniformly for Latin, Greek, Cyrillic, CJK and emoji. Input is read as UTF-8 text, decoded to code points, then re-escaped.
Escaped output is valid inside JSON strings, JavaScript string literals, Java strings, C strings and many configuration formats, which is why this representation is so common in generated code and localisation files.
Processing is local and synchronous. Nothing is sent over the network, and the tool keeps no memory of past conversions.
Every code point has a unique escape, so the mapping is unambiguous in both directions. A source file written entirely in escapes contains only ASCII bytes, which means it survives any text editor, any diff tool and any build pipeline that normalizes line endings.
The four hex digits are case-insensitive and the leading zeros are significant - \u0041 is A while \u41 alone would be invalid. Keeping the width fixed is what lets the escape remain unambiguous inside a longer string.
Frequently Asked Questions
Why would I escape text into unicode sequences?
To make a string safe for a parser that rejects certain raw characters, or to keep an encoding-agnostic source file that builds identically on every machine. Escaped text contains only ASCII and can never trip a charset mismatch.
Does \u0041 mean the letter A?
Yes. It is the code point 41 hex, which is the capital letter A. Escapes are just numbers written in a recognizable way; decoding reveals the character they stand for.
Will an emoji survive a round trip?
Yes. The tool writes the emoji as its two surrogate escapes, and decoding reassembles them. The result is the exact original character.
Is this the same as HTML encoding?
No. Unicode escapes use the \uXXXX syntax for JSON and programming languages, while HTML encoding uses entities like 你. This tool handles the former; the HTML encoder handles the latter.
Does the tool upload my text?
No. Conversion runs entirely in your browser. The text is processed in memory and never transmitted, stored or logged.
Why are some characters written as two escapes?
Characters above U+FFFF are stored as two 16-bit halves in the UTF-16 model that JavaScript and Java use. Each half becomes one escape, and together the pair reconstructs the single original character.
Does converting change the meaning of my text?
No. An escape sequence decodes to exactly the same character it stands for. Escaping is purely a change of spelling that lets a plain-ASCII file carry any text at all.
Can I read escaped text without a converter?
With practice, partially - the leading hex digits follow recognizable patterns: 4 for CJK, 20 for punctuation, 1F6 for many emoji. For anything longer than a handful of characters, the tool is faster and exact.
Data & Privacy
Your data stays in your browser. Nothing is uploaded.
- Processing
- Local
- Upload
- None
- Server Storage
- None
- Account
- Not required
Related Tools
Base64 Encode & Decode
Convert text to Base64 or decode it back, with an optional URL-safe mode - all in your browser.
Encoding & Conversion
URL Encoder / Decoder
Percent-encode text for safe use in URLs and query strings, or decode it back to readable form.
Encoding & Conversion
HTML Entity Encoder / Decoder
Convert HTML to its escaped entity form or decode entities back to readable markup.
Encoding & Conversion
Hex Converter
Convert text to hex bytes and back, revealing the UTF-8 representation of any string.
Encoding & Conversion
Binary Converter
Convert text to its 8-bit binary form and decode binary strings back to readable text.
Encoding & Conversion
URL Parser
Break any URL into protocol, host, path, query parameters and fragment for easy inspection.
Encoding & Conversion