Unicode Escape & Unescape
Encoding & CryptoEverything runs locally in your browser — nothing is uploaded
Convert non-ASCII characters to escape sequences, and back again. Each form has its place: \uXXXX for JavaScript, Java, C# and .properties files; \xXX for raw UTF-8 bytes as written in Python, C and PHP (\xE4\xB8\xAD is one CJK character); &#xXXXX; for HTML numeric references. Emoji come out as the standard surrogate pair \uD83D\uDE00 rather than \u{1F600}, which Java and .properties files do not understand. Backslashes and ampersands are escaped too, so that decoding is an exact inverse of encoding — otherwise a literal \u0041 sitting in your text would be read back as the letter A.
Features
- Both directions: non-ASCII text and emoji ⇄ escape sequences
- Three forms: \uXXXX (JS / Java), \xXX (UTF-8 bytes) and &#xXXXX; (HTML numeric references)
- Decoding recognises all three forms at once, even when they are mixed in one string
- Emoji written as the standard surrogate pair, accepted by Java and .properties files
- Backslashes and ampersands escaped so that decode(encode(x)) === x holds exactly
- Also understands the \u{1F600} and \U0001F600 code point notations
- Unrecognised escapes are passed through instead of throwing
How to use
- Pick the direction: encode or decode
- Choose the escape form you need when encoding
- Paste your content — the result appears instantly
- Click Copy to take the result
FAQ
- Why does a CJK character become three bytes in the \xXX form?
- Because \xXX stands for a single byte, and CJK characters do not fit in one. They are encoded as UTF-8 first: the character U+4E2D is E4 B8 AD, written \xE4\xB8\xAD. That is exactly how Python bytes objects and C string literals look. Decoding follows the same rule, so whether it round-trips depends on those bytes forming valid UTF-8.
- Why did \u0026 and \u005C appear in my output?
- To make decoding an exact inverse of encoding. Your text may already contain something like \u0041 or 中, and without escaping the backslash and the ampersand the decoder would treat them as real escape sequences and silently produce the wrong result. The escaped output is still restored correctly by anything that understands \u escapes: JavaScript, Java and .properties files.
- Why do emoji become two \u escapes instead of one?
- U+1F600 is outside the Basic Multilingual Plane, so in UTF-16 it must be written as the surrogate pair \uD83D\uDE00. Java and .properties files only accept that form, never \u{1F600}, so encoding emits pairs; decoding joins adjacent pairs back into a single character.
- Does decoding fail on a broken escape?
- No. All three forms are recognised at once, and anything unrecognised — a half-written \uD8, an out-of-range �, or an escape from another language such as \n — is left exactly as it was. Real-world text mixes in unrelated escapes all the time, and failing the whole input would cost you the parts that were perfectly fine.
Related tools
HTML Entities
Encoding & CryptoTurn < > & and quotes into HTML entities and decode them back in a single pass, so &lt; becomes <, not an angle bracket. Runs in your browser.
Base64
Encoding & CryptoConvert text to Base64 and back, with correct UTF-8 handling for accents, CJK and emoji. Runs entirely in your browser — nothing is uploaded.
Chinese Converter
TextConvert Chinese between simplified and traditional characters, leaning on common words first and the most usual form for the rest, all in your browser.
URL Encode
Encoding & CryptoEscape text into %XX form and back again, treating a whole URL and a single parameter value as different jobs. Runs entirely in your browser.
JWT Decoder
Encoding & CryptoSplit a JWT into header, payload and signature, and read iat, nbf and exp as dates. The signature is not verified — decoding only, all in your browser.
Hash
Encoding & CryptoCompute MD5, SHA-1, SHA-256 or SHA-512 digests of any text, hashed as UTF-8 bytes so they match openssl and sha256sum exactly. Runs in your browser.