Free & private
Code strings

Unicode escape converter

Turn characters into the \u and \x escape sequences used in source code, and convert those escapes back into the characters they stand for.

Reversible100% FreeNo upload
Unicode escape
Code strings · reversible · UTF-8
try
Input0 chars · 0 bytes
Output0 chars · 0 bytes
UTF-8 · ready⌘⏎ copy⌘⇧S swap● local

What Unicode escapes are

When a character is hard to type, unsafe to store, or outside the ASCII range, programming languages let you write it as an escape sequence — a backslash followed by a code. \u00e9 is é, \x41 is A. The escapes keep source files in plain ASCII while still representing any character, which avoids encoding surprises when code moves between editors and systems.

The three styles

  • \uXXXX — four hex digits per UTF-16 code unit, the form used by JavaScript, Java, JSON and C#. Characters above U+FFFF become a surrogate pair of two escapes.
  • \xXX — two hex digits per byte of the UTF-8 encoding, common in Python byte strings and PHP.
  • \u{...} — the modern code-point form (ES6, Rust), which writes any character as a single value without surrogate pairs.

How to use this tool

  1. Paste text and Encode in the style your language expects.
  2. Paste a string full of escapes and Decode to see the real characters. The decoder accepts all three styles at once, so mixed input works.

When to reach for escapes

Escapes are handy for invisible or ambiguous characters — a non-breaking space, a zero-width joiner, a right-to-left mark — that would otherwise be impossible to see in code review. Encoding a confusing string to \u form makes exactly what it contains visible.

Examples

Inputcafé ☕
Outputcaf\u00e9 \u2615
Inputµ€
Output\u0100\u00b5\u20ac

Frequently asked questions

What is the difference between \u and \x?
\uXXXX uses four hex digits per UTF-16 code unit (JavaScript, Java, JSON). \xXX uses two hex digits per UTF-8 byte (Python, PHP). They describe the character at different levels.
How are characters above U+FFFF handled?
In \uXXXX style they become a surrogate pair of two escapes, which is how UTF-16 represents them. The \u{...} style writes them as a single code point instead.
Can I decode a mix of escape styles?
Yes. The decoder understands \u{...}, \uXXXX and \xXX together, so mixed input is fine.
Is anything uploaded?
No, the conversion runs locally in your browser.

Related tools

Every tool on encoder.website converts your text and hands the result straight back — it is never stored. Pick another tool from the sidebar any time.