ToolHub
๐Ÿˆฏ

Unicode Escape

\uXXXX, \u{...}, U+XXXX and HTML entity notations.

Escaped
โ€”

About the Unicode Escape

Escape text into five Unicode notations โ€” \uXXXX for JS and JSON, \u{...} for ES6, a U+ code point list, and HTML numeric entities in hex or decimal โ€” or decode any of them back to characters. Astral characters like emoji are handled correctly, including surrogate pair output for the \uXXXX form.

How to use the Unicode Escape

  1. Choose the Encode or Decode tab.
  2. Pick a notation from the dropdown, for example \uXXXX (JS/JSON).
  3. Type text to escape, or paste escaped text to unescape.
  4. Copy the result from the output box.

Unicode Escape FAQ

Why does an emoji become two \u escapes?

The \uXXXX notation only reaches code points up to U+FFFF, so characters beyond that are written as a UTF-16 surrogate pair โ€” two four-digit escapes that JavaScript and JSON reassemble correctly.

Which notation should I pick?

Use \uXXXX for JSON and classic JavaScript strings, \u{...} for modern ES6 code, U+ for documentation and design specs, and the HTML entity forms for web pages with restricted encodings.

Does decoding handle mixed input?

Each notation mode decodes its own escape style; paste input in the matching notation, and HTML entity decoding accepts both hex and decimal references.