Unicode Escape/Unescape
Convert text to \uXXXX escape sequences and back, including emoji and surrogate pairs. Runs entirely in your browser; nothing you type is ever sent anywhere.
Quick Learn
A \uXXXX escape represents one UTF-16 code unit as four hex digits — the same escape syntax JSON and JavaScript string literals use internally. Most characters (Latin letters, common symbols, most non-English scripts) fit in a single code unit, so café becomes caf\u00e9. Characters outside the Basic Multilingual Plane — most emoji included — need two UTF-16 code units, called a surrogate pair, so a single 🚀 becomes two escapes: \ud83d\ude80. That's normal, not an error; concatenated together, those two code units represent exactly one character.
You'll also sometimes see \u{XXXXX} — ES6's code-point escape syntax, valid in modern JavaScript string and regex literals — which lets a single escape represent a supplementary-plane character directly, without splitting it into a surrogate pair. This tool's decoder recognizes both forms in the same input, since real-world text mixes escapes copied from JSON payloads (always \uXXXX pairs) with escapes copied from JS source code (sometimes \u{XXXXX}).
Best Practices
- •Two adjacent \uXXXX escapes for one emoji aren't a bug — that's a surrogate pair, JavaScript's native way of representing a character outside the Basic Multilingual Plane as two 16-bit code units.
- •JSON.stringify() escapes text this same way — pasting a JSON string value here and encoding it should reproduce recognizable \uXXXX sequences, useful for verifying what a JSON payload actually contains byte-for-byte.
- •If you're writing the escapes into JavaScript source code by hand, \u{XXXXX} for a single emoji is more readable than the equivalent surrogate pair — but only \uXXXX pairs are valid inside a JSON string.
- •Decoding is a good way to make an obfuscated or escaped string (e.g. from a minified bundle or a phishing email's spoofed text) human-readable again before deciding whether to trust it.
More Encoding Tools
Base64 Encode/Decode
Convert text to and from Base64, with correct UTF-8 handling.
URL Encode/Decode
Percent-encode or decode a query string, path segment, or full URL.
HTML Entity Encode/Decode
Escape or unescape HTML entities like &, <, and '.
Hex ↔ Text Converter
Convert text to hexadecimal bytes and back, for byte-level debugging.
Gzip Compress/Decompress
Compress text with gzip or deflate, or decompress a Base64-encoded blob.
Frequently Asked Questions
Want the engineering deep-dives behind tools like this one?