Unicode Escape — Online \uXXXX Encoder & Decoder
🔒 Runs in your browser — nothing is sent to a serverUnicode escape converter that flips any text into JavaScript / Java / Python / C escape sequences and back, in a single click. Pick a direction (encode or decode), choose an escape format — `\uXXXX`, `\u{XXXXX}`, `\UXXXXXXXX`, `\xXX`, or legacy `%uXXXX` — and a scope (only non-ASCII, every character, or just control codes), and the converter walks each Unicode code point and emits the matching escape. Surrogate pairs for emoji and rare scripts are produced and consumed automatically. Everything runs 100% inside your browser; your input never leaves your device, nothing is uploaded, logged or sent to any server.
\uXXXX uses surrogate pairs for code points above U+FFFF (e.g. emoji).
When to use a unicode escape converter
You need unicode escapes any time a string has to travel through a channel that does not handle the full Unicode range cleanly: embedding non-ASCII text into a JavaScript or Java source file, writing a literal that survives an ASCII-only transport, generating a JSON payload where a downstream parser is fussy about UTF-8, building a regex that needs explicit surrogate halves, or sanity-checking a log line that arrived already-escaped from another system. Running the convert in a trustworthy, offline-first page means the original text — and any escapes it might reveal — never touch a server.
How unicode escape and unescape work
Encoding walks the input one Unicode code point at a time (note: not one UTF-16 code unit — a surrogate pair counts as one character). Each code point is checked against the chosen scope (non-ASCII only, all characters, or control codes only) and, if it should be escaped, formatted in the chosen escape form. For `\uXXXX` and `%uXXXX`, code points above U+FFFF are emitted as a surrogate pair; for `\u{XXXXX}` and `\UXXXXXXXX`, the entire code point goes into one escape. Decoding is a single regex pass that recognises all five forms simultaneously, parses the hex digits with `parseInt(..., 16)`, and emits the character via `String.fromCodePoint`.
Examples
Γεια\u0393\u03B5\u03B9\u03B1cafécaf\u00E9😀\uD83D\uDE00\u0048\u0065\u006C\u006C\u006F\u002C\u4E16\u754CHello,世界\u{1F600}😀