Skip to content

Unicode / Escape Converter

Convert text to uXXXX, u{…}, U+XXXX code points or HTML numeric entities and back. Astral-safe, runs entirely in your browser.

Runs entirely in your browser. Nothing you paste here is sent to us or anyone else — there is no server processing, no logging of input, and no third-party scripts on this page.

A Unicode escape converter turns readable text into escape sequences — JavaScript uXXXX, ES6 u{…}, a U+XXXX code point list, or HTML numeric entities — and turns any of those back into text. The tool above does both directions in your browser: pick Encode or Decode, choose a format, and copy or download the result. Nothing you paste is transmitted anywhere.

What is a Unicode escape?

Every character you type has a Unicode code point — a number that identifies it in the universal character set, written as U+ followed by hexadecimal, like U+0041 for the letter A or U+00E9 for é. When a character cannot be typed directly, or must survive a channel that only tolerates plain ASCII, it is written as an escape sequence instead: a short piece of ASCII that a program expands back into the original character.

Different ecosystems use different escape syntaxes for the same idea:

Form Example (é) Where it appears
uXXXX é JavaScript, Java, JSON, C#
u{…} u{E9} Modern JavaScript, Rust, Swift
U+XXXX U+00E9 Documentation, the Unicode standard
&#DDDD; é HTML, XML (decimal)
&#xXXXX; é HTML, XML (hexadecimal)

The astral plane and surrogate pairs

The first 65,536 code points (U+0000 to U+FFFF) make up the Basic Multilingual Plane. Everything above it — most emoji, extended CJK ideographs, musical notation, and ancient scripts — lives in the astral planes. JavaScript stores strings as UTF-16, where a single astral code point is represented by two 16-bit units called a surrogate pair. That is why the rocket 🚀 (U+1F680) becomes 🚀 in classic uXXXX output but a single u{1F680} in ES6 form. This converter uses codePointAt and String.fromCodePoint so it always counts and reconstructs whole characters, never breaking a pair in half.

Common use cases

  • Embedding non-ASCII text safely in source code, JSON, or a config file that must stay ASCII-clean.
  • Revealing invisible or look-alike characters — a non-breaking space, a zero-width joiner, or a Cyrillic letter posing as Latin — by escaping everything and reading the code points.
  • Reading a log line or API payload that arrived full of uXXXX escapes.
  • Converting HTML numeric entities back to plain text, or the reverse for markup.
  • Looking up the exact U+ code points in a string to check against the Unicode database.

A worked example

Take café 🚀. Encoding with the JavaScript format and “Non-ASCII only” ticked keeps the ASCII letters literal and escapes the rest: café 🚀. Switch to ES6 and the emoji collapses to a single u{1F680}. Switch to the U+ list and you get U+00E9 U+1F680, the bare code points. Paste any of those back with Mode set to Decode and you recover café 🚀 exactly.

Common pitfalls

  • Truncated escapesuXXXX needs exactly four hex digits. uE9 is invalid; the value is é.
  • Mixing planes — a lone surrogate (one half of a pair) is not a valid character on its own. Encode from real text rather than editing escapes by hand.
  • Decimal vs hex — HTML é is decimal, é is hex. They describe the same character but the x matters.
  • Case — hex digits are case-insensitive on input; this tool emits uppercase for consistency.

Does it run locally?

Yes — everything happens in your browser. The conversion uses native JavaScript string methods on your device, with no server round-trip, no logging, and no third-party analytics on this page. You can load the tool once and finish your work with the network disconnected. Even so, treat any online utility with sensible caution and avoid pasting production secrets into tools you have not verified.

Frequently asked questions

What does this converter do?

It converts plain text into escape sequences — JavaScript \uXXXX escapes, ES6 \u{…} code point escapes, a U+XXXX code point list, or HTML numeric entities — and reverses any of those back into readable text. Switch the Mode selector between Encode and Decode.

How are emoji and other astral characters handled?

Correctly. Characters above U+FFFF (emoji, many CJK extensions, historic scripts) live outside the Basic Multilingual Plane. In JavaScript \uXXXX mode they are written as a surrogate pair (two \u escapes); the ES6 \u{…}, U+ and HTML formats write the single real code point. Decoding reassembles them either way.

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

Both are JavaScript string escapes. \uXXXX takes exactly four hex digits and can only address the BMP, so anything higher needs a surrogate pair. \u{…} (ES2015 and later) accepts a full code point of any length, so an emoji is a single \u{1F680}. Use \u{…} for modern engines and \uXXXX for maximum compatibility.

What does "Non-ASCII only" mean?

When ticked, printable ASCII (space through tilde) is left as literal text and only characters outside that range are escaped — handy for keeping code and markup readable while making non-ASCII visible. Untick it to escape every character. In U+ list mode it controls whether ASCII code points are listed.

Which forms can the decoder read?

It recognises \uXXXX, \u{…}, \xXX (two-digit byte escapes), U+XXXX code point notation, and HTML numeric entities in both decimal (—) and hexadecimal (—) form. It replaces every match it finds and leaves the rest of the text untouched.

What is a code point versus a character?

A code point is the numeric identity of a character in the Unicode standard, written U+ followed by hex, such as U+00E9 for é. Most characters are a single code point, but in UTF-16 (which JavaScript strings use) a code point above U+FFFF is stored as two 16-bit code units — the surrogate pair you see in \uXXXX output.

Is my text sent anywhere?

No. The whole conversion runs in your browser with built-in string functions. Nothing you type is uploaded, logged, or stored, and the page keeps working with the network disconnected.

Why does my decoded text still show some escapes?

Only sequences that match a supported pattern and resolve to a valid code point (U+0000 to U+10FFFF) are converted. Malformed escapes, an incomplete \u with fewer than four digits, or values out of range are left exactly as written so nothing is silently corrupted.