Loading...

Unicode Escape Online — \uXXXX Converter for Strings

Escape any text to JavaScript-style `\uXXXX` Unicode sequences, or convert escaped sequences back to readable characters. The converter handles surrogate pairs (emoji, CJK extended), supports both `\u` (BMP) and `\U` (non-BMP code points), and runs entirely in your browser — safe for product names, customer messages, and localized strings.

Features

  • Full Unicode coverage

    Handle emoji, CJK ideographs, surrogate pairs, and astral plane characters correctly.

  • \uXXXX and \u{XXXXX}

    Toggle between fixed-width \uXXXX and ES6 \u{XXXXX} (any code point) syntax.

  • Selective escaping

    Escape only non-ASCII characters or every character — whichever your downstream system requires.

  • Private by default

    Nothing is uploaded; localization strings stay on your machine.

How to escape Unicode characters online

Convert any text to or from \uXXXX sequences.

  1. Pick directionChoose Escape (text → \uXXXX) or Unescape (\uXXXX → text).
  2. Choose scopeDecide whether to escape only non-ASCII characters or every character.
  3. Paste your inputDrop the text into the input box. The output appears instantly.
  4. Copy the resultUse the copy button to paste the escaped string into your source code or config file.

Examples

Escape a CJK string

Input
你好世界
Output
\u4f60\u597d\u4e16\u754c

Escape an emoji (surrogate pair)

Input
🚀
Output
\ud83d\ude80   // surrogate pair
\u{1F680}      // ES6 code point

Unescape back to text

Input
\u00e9\u00e8
Output
éè

Frequently Asked Questions

What is a Unicode escape?
A Unicode escape represents a character using its code point. In JavaScript, `\uXXXX` represents a Basic Multilingual Plane code point and `\u{XXXXX}` (ES6+) represents any code point up to `\u{10FFFF}`.
Why does an emoji escape to two `\u` sequences?
Characters beyond the BMP (code point > U+FFFF), including most emoji, are encoded as UTF-16 surrogate pairs. The fixed-width `\uXXXX` form needs two escapes; the ES6 `\u{XXXXX}` form needs only one.
How is this different from URL or HTML encoding?
Unicode escapes are for source code and string literals (JavaScript, JSON, Java, Python). URL encoding (`%XX`) is for URLs. HTML entities (`&#XX;`) are for HTML content. Each has its own escape grammar.
Can I escape only the non-ASCII characters?
Yes. Select "non-ASCII only" to keep regular characters readable and escape just the ones that need it — handy for JSON files that should look natural in diffs.
Is the conversion reversible?
Yes, escape and unescape are inverses. Round-tripping a string returns the original input.