Skip to main content
ToolsHub

Unicode Escape / Unescape

Convert non-ASCII characters to JavaScript, HTML or CSS Unicode escapes — or decode them back to text — instantly in your browser.

Updated

Files never leave your browser

How to use Unicode Escape / Unescape

The Unicode Escape / Unescape tool converts non-ASCII text into Unicode escape sequences and decodes them back to readable characters, instantly in your browser. Choose a target format — JavaScript \uXXXX, HTML hexadecimal or decimal entities, or CSS \HH escapes — and the tool encodes every character above the ASCII range while leaving plain letters and punctuation untouched. The unescape mode reverses any mix of these formats. It is a fast, private way to embed accented characters, symbols and emoji into source code that must stay ASCII-safe.

  1. Choose "Escape" to encode text, or "Unescape" to decode escape sequences.
  2. When escaping, pick the output format — JavaScript, HTML hex, HTML decimal or CSS.
  3. Paste or type your text into the input area.
  4. Watch the converted result appear live in the output panel.
  5. Copy the escaped or unescaped result for use in your code or markup.

Your data never leaves your device — 100% private processing.

Why escape Unicode characters at all?

Although modern files are almost always UTF-8, there are still many contexts where ASCII-only text is safer or required. Some legacy build pipelines, terminals, configuration formats and email systems mangle bytes above 127, and a stray non-breaking space or smart quote can be invisible yet break parsing. Escaping turns those characters into an unambiguous ASCII representation — \u00e9 for é, for instance — that survives copy-paste, diffing and transport untouched. It also makes hidden characters visible: when you escape a string you can immediately see which characters were non-ASCII, which is invaluable for debugging encoding bugs.

The same character in each escape format
CharacterJavaScriptHTML hexCSS
é (U+00E9)\u00E9é\0000E9
€ (U+20AC)\u20AC€\0020AC
😀 (U+1F600)\u{1F600}😀\01F600

Handling characters beyond the basic plane

Characters with a code point above U+FFFF — including most emoji and many historic scripts — live in the so-called astral planes and cannot be represented by a single four-digit \uXXXX escape. JavaScript solves this two ways: the modern \u{...} form takes the full code point directly, while older code uses a surrogate pair of two \uXXXX escapes. This tool emits the clear \u{...} form when escaping for JavaScript and correctly decodes both the \u{...} form and surrogate pairs when unescaping, so round-tripping emoji and other astral characters is lossless. HTML and CSS escapes naturally accept the full code point, so no special handling is needed there.

Worked examples

Escape to JavaScript

Inputs: café

Result: caf\u00E9

Unescape HTML entities

Inputs: café

Result: café

Glossary

Code point
The numeric value assigned to a character in the Unicode standard, written as U+ followed by hexadecimal digits.
Escape sequence
An ASCII-safe representation of a character, such as \u00e9 or é, used where the literal character cannot appear.
Astral plane
Any Unicode code point above U+FFFF, including most emoji, which requires special encoding in some languages.
Surrogate pair
Two 16-bit code units that together represent a single astral-plane character in UTF-16 and older JavaScript escapes.
HTML entity
A markup escape such as € or € that represents a character by its code point.

Related reading

Frequently Asked Questions

Free · No spam

Get weekly tool tips & updates

New tools, power-user tips, and productivity hacks — delivered free every Friday.

No spam, ever. Unsubscribe with one click.

Why use Unicode Escape / Unescape?

  • Escape accented letters, symbols and emoji into JavaScript, HTML or CSS Unicode sequences
  • Decode any mix of \uXXXX, HTML entity and CSS escapes back to readable text
  • Keeps ASCII characters intact so escaped output stays human-readable
  • Handles astral-plane characters (emoji) using \u{...} and surrogate-aware decoding
  • Runs entirely in your browser, so text is never uploaded to a server

Common use cases

  • Embed non-ASCII characters in a source file that must remain pure ASCII
  • Encode special characters as HTML entities for safe inclusion in markup
  • Insert Unicode glyphs into CSS content properties using \HH escapes
  • Decode escaped strings copied from minified JavaScript or JSON to read them
  • Inspect exactly which characters in a string are non-ASCII

Related Developer Tools

Explore all Developer Tools.