devtools

Unicode Escape / Unescape

Convert text to JavaScript-style Unicode escapes and back. Escape only non-ASCII or every character, and unescape emoji and hex escapes in your browser.

Runs entirely in your browser — your data never leaves your device.

How to use Unicode Escape / Unescape

What it does & when you need it

This tool rewrites text as JavaScript-style Unicode escapes and turns those escapes back into readable characters. Reach for it when a non-ASCII string has to travel through an ASCII-only channel — a legacy config file, a source-code constant, a URL parameter, or a system that mangles anything above plain English. Escaping makes every accented letter, CJK glyph, or emoji explicit and transport-safe; unescaping does the reverse so you can read what a \uXXXX-laden string actually says.

How to use

  1. Pick Escape or Unescape.
  2. In Escape mode, choose a Scope: Non-ASCII only keeps ordinary text readable and escapes just the exotic characters, while All characters escapes every code point.
  3. Type or paste on the left, or press Sample. The result appears on the right — copy it with Copy result or Ctrl/Cmd + Enter.

Things worth knowing

Astral characters use the brace form. Escaping walks the string by code point, so an emoji such as U+1F600 becomes a single \u{1F600} rather than a surrogate pair. The classic \uXXXX form only reaches U+FFFF; the \u{...} form goes all the way to U+10FFFF.

Unescaping is generous. It accepts \uXXXX, the braced \u{...} form, and the two-digit \xXX byte escape, and it recombines a surrogate pair written as two \uXXXX escapes back into one character. A broken escape, like \uZZ or a code point above the maximum, is reported instead of silently corrupting the output.

It is not HTML or URL escaping. Those target markup and query strings; this targets characters inside a string. For markup use the HTML Entities tool, and to escape quotes and newlines for a JSON string literal see Backslash Escape.

Examples

Escape accented text

Crème brûlée à la mode

In Non-ASCII mode the accented letters become \uXXXX escapes while the ASCII text stays intact.

Escape an emoji

Ship it 🚀😀

Astral emoji are emitted as single \u{...} code-point escapes rather than surrogate pairs.

Unescape a sequence

\u0048\u0065\u006C\u006C\u006F \u{1F44B}

Switch to Unescape mode to turn the escapes back into "Hello 👋".

Frequently asked questions

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

\uXXXX is a fixed four-hex-digit escape that only reaches code points up to U+FFFF, the Basic Multilingual Plane. Characters above it, such as most emoji, need either a surrogate pair of two \uXXXX escapes or the newer \u{...} form, which takes one to six hex digits. This tool emits \u{...} for those astral characters so each is a single escape.

How are emoji and other astral characters handled?

Escaping walks the text by code point, so an emoji like 😀 (U+1F600) becomes a single \u{1F600} rather than a confusing pair of surrogate halves. When unescaping, both spellings work: \u{1F600} and the surrogate pair 😀 each decode back to the same emoji.

What does the non-ASCII versus all-characters option do?

Non-ASCII escapes only the characters above U+007F, leaving ordinary letters, digits, and spaces readable — ideal for making a string ASCII-safe while keeping it legible. All characters escapes every code point, which helps when even spaces or punctuation must be encoded.

Which escape forms can it decode?

The unescaper understands \uXXXX, the braced \u{...} form, and the two-digit \xXX byte escape, and it stitches a surrogate pair written as two \uXXXX escapes back into one character. A malformed escape, such as \uZZ or an out-of-range code point, is reported rather than silently mangled.

Does this run privately in my browser?

Yes. Escaping and unescaping happen entirely in your browser with no network request, so source code, tokens, or non-English text never leave your machine, and the tool keeps working offline once loaded.