Skip to main content
eyunzhu

Unicode escape converter

Convert readable text to Unicode escapes and back, including UTF-16 pairs, code point escapes, emoji and common control characters.

Format
Updates as you type or change an option

Updates as you type or change an option

Processed in this browser. Nothing is uploaded or saved.

About this tool

Inspect escaped API text without running JavaScript. The result is converted text, not a complete quoted string literal ready for every programming language.

How to use

Enter readable text on the left or escaped text on the right. UTF-16 mode uses \uXXXX; code point mode uses \u{...} for characters outside the basic multilingual plane.

Decoding also accepts \xXX, newline, tab and backslash escapes. Invalid code points, incomplete escapes and unpaired surrogates are rejected. No JavaScript is executed. Input limit: 2 MiB.

Common questions

Why does one emoji produce two Unicode escapes?

UTF-16 represents some characters with a surrogate pair. Code point mode can use one \u{...} escape instead. JSON accepts \uXXXX escapes but not the braced code point syntax.

How do I decode a sequence copied from an API?

Paste the escape sequence on the encoded side: \u0041\nB becomes A, a line break and B. Do not add enclosing quotes; they would remain part of the text.

What should I check after an invalid escape error?

Look for a trailing backslash, an incomplete \uXXXX sequence or an unpaired surrogate. Restore the missing source characters; the tool cannot infer them or evaluate JavaScript expressions.

Comments

0
to join the discussion.
No comments yet.
Reply thread

Follow the complete conversation chronologically; each reply identifies the specific message it answers.