Home › Tools

\u JavaScript Escapes

Escape text as \uXXXX, JSON surrogate pairs, or a quoted JSON string, and unescape it back.

About the JavaScript Escapes

JavaScript and JSON write characters that are awkward to type as \u escapes. This page produces those escapes and reads them back.

How to use it

Questions

Why are there two ways to escape an emoji?

Modern JavaScript can write \u{1F44B}. JSON cannot, so it uses the UTF-16 pair \uD83D\uDC4B.

What does the JSON string option add?

It wraps the text in quotes and escapes quotes, backslashes and line breaks the way JSON.stringify does.

More tools