Unicode Escape / Unescape

One input per line. Output is numbered to match the input order.
Pinned tools are listed in your favourites on the home page.Copies a link to this tool that carries your current input, so it opens ready to run.Gives you an iframe snippet for putting this tool on your own site.
Ctrl+Enter Run  · Ctrl+Shift+C Copy  · Esc Clear

Understand Unicode Escape / Unescape

Unicode escaping rewrites non-ASCII characters as \uXXXX codes so text survives files, fields, and systems that only accept plain ASCII.

How it works

Every character above code point 127 is replaced by a backslash-u and its hexadecimal code point, so é (U+00E9) becomes \u00E9. Characters above U+FFFF — emoji and most historic scripts — do not fit in four hex digits, so the tool emits the ES2015 brace form, \u{1F30D}. ASCII characters are left exactly as they were, which keeps the output readable and diffable.

When to use it

  • Pasting non-ASCII text into a Java .properties file or a source file whose encoding you do not control.
  • Finding out which character is actually in a string when two lookalikes — a hyphen and an en dash, a space and a non-breaking space — make a comparison fail.
  • Writing a regex or a test fixture where an invisible character needs to be visible on the page.
  • Sending text into a legacy system or a database column restricted to ASCII.

Watch out for

  • The brace form \u{1F30D} is valid JavaScript and invalid JSON. JSON requires the surrogate pair \uD83C\uDF0D for the same character, so escaped emoji cannot be pasted straight into a .json file.
  • Escaping does not change the string, only how it is written. Two strings that look identical can still differ — é is either one code point (U+00E9) or an e followed by a combining accent (U+0065 U+0301) — and escaping is how you see which one you have.
  • \uXXXX, \xXX, and %XX are three different things: a code point, a byte, and a URL escape. Mixing them is a routine source of mojibake.

Frequently Asked Questions

What are Unicode escape sequences?

Unicode escapes represent characters using their code points: \u0041 = "A", \u1F600 = 😀. They appear in JavaScript string literals, JSON files, Java properties, and CSS content values to safely represent any character in ASCII source code.

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

\uXXXX (4 hex digits) covers the Basic Multilingual Plane (U+0000–U+FFFF). Characters above U+FFFF (emoji, rare symbols) need surrogate pairs (two \uXXXX sequences) or the modern \u{XXXXXX} extended escape supported in ES2015+.

When do Unicode escapes appear in real code?

Developers use escapes in regex patterns (\u0041), Java .properties files, JSON payloads to ASCII-only systems, database fields with restricted charset, and when embedding text in source files where the IDE doesn't support non-ASCII.

How to Use Unicode Escape / Unescape

  1. Paste or type your input in the input area above.
  2. The tool processes your input automatically or click Run.
  3. Copy or download the result using the action buttons.
  4. Use Ctrl+Enter to run quickly from the keyboard.