Skip to content
DDevToolery

Unicode Escape / Unescape

Convert between characters and \uXXXX escape sequences.

Loading tool…

About this tool

Converts characters to and from \u escape sequences, which is how non-ASCII text is embedded in source code and JSON when the file must stay ASCII-only.

Limitations

  • Characters outside the Basic Multilingual Plane are emitted as surrogate pairs, which is how JavaScript stores them.

Questions

Why did one emoji become two escapes?
Characters above U+FFFF are encoded as a surrogate pair in UTF-16, so they take two \u escapes. Splitting them apart produces invalid text.

Privacy

This page does its work in your browser. What you paste is processed by JavaScript running on your own device and is never sent to a DevToolery server — there is no server that could receive it. The page itself is a static file delivered by a CDN. See exactly what is stored.