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
- Paste text and Encode in the style your language expects.
- 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
Frequently asked questions
What is the difference between \u and \x?
How are characters above U+FFFF handled?
Can I decode a mix of escape styles?
Is anything uploaded?
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.