>Fafa Dev Tools

Unicode Escape/Unescape

Convert Unicode characters to \uXXXX escape sequences and back. Free online Unicode escape unescape tool with surrogate pair support.

0 chars
Output will appear here...

What is Unicode Escape/Unescape?

Unicode escape sequences represent characters using the \uXXXX format, where XXXX is the character's code point in hexadecimal. For example, the Chinese character 'δΈ–' becomes \u4E16. This format is used in JSON, JavaScript strings, Java properties files, and many configuration formats to safely encode non-ASCII characters.

How to Use

  1. Select Escape or Unescape mode using the toggle buttons
  2. In Escape mode: type text with Unicode characters to see \uXXXX sequences
  3. In Unescape mode: paste \uXXXX sequences to see the decoded characters
  4. Use Swap to reverse the direction

Examples

Escape Unicode text

InputHello δΈ–η•Œ!
OutputHello \u4E16\u754C!

Unescape sequences

Input\u0048\u0065\u006C\u006C\u006F
OutputHello

Frequently Asked Questions

What is the difference between \uXXXX and \u{XXXXX}?

\uXXXX is the standard 4-digit format (BMP, code points 0-65535). \u{XXXXX} is ES6 syntax that supports any code point including those above 65535 (like emojis). This tool supports both formats for unescaping and uses \u{XXXXX} for surrogate pairs when escaping.

Why do some characters produce two escape sequences?

Characters outside the Basic Multilingual Plane (code points above 65535, like many emojis) are represented as surrogate pairs in UTF-16. For example, πŸ˜€ (U+1F600) uses two 4-digit escapes: \uD83D\uDE00. The tool also supports ES6 \u{1F600} syntax.

Where are Unicode escape sequences used?

JSON strings, JavaScript source code, Java .properties files, Python string literals, CSS content properties, and many configuration file formats. They allow files to remain ASCII-only while representing any Unicode character.