⌨ DEVELOPER · ENCODER

Unicode Escape

Convert any text — accented letters, symbols, emoji, Hindi, Chinese — into Unicode escape sequences for JavaScript, JSON, Python, HTML or CSS, or list each character's U+ code point. Keep ASCII readable and escape only the rest, or escape everything.

7 formats · Correct surrogate pairs · Emoji-safe · ASCII kept readable
Tip: JavaScript / JSON output can be pasted straight into a JSON string or a .js file with any file encoding.Need to decode instead? Unicode Unescape →
Text Any Unicode text
Escaped
Characters: –
Escaped: –
Output: –
Time: –
Unicode 15+ · 100% Client-Side
◆ ABOUT THIS TOOL

What Is a Unicode Escape?

A way to write any character using only plain ASCII.

Every character has a Unicode code point — a number written as U+00E9 (é) or U+1F600 (😀). An escape sequence writes that number in the syntax of a programming language, so source code and data files can contain any character while staying pure ASCII. That avoids broken characters when a file's encoding is wrong.

Each language has its own syntax. JavaScript and JSON use \uXXXX with exactly four hex digits, so characters above U+FFFF — most emoji — become two escapes called a surrogate pair (😀 → \uD83D\uDE00). This tool calculates those for you.

Other formats. ES6 JavaScript accepts \u{1F600}, Python uses \u00e9 and \U0001F600, HTML uses é or é, and CSS uses \E9 — the tool adds the required space when a hex digit or space follows.

Non-ASCII only (default) escapes characters above U+007E plus invisible control characters, so normal text stays readable. Tabs and line breaks are kept as they are.

⌘ REFERENCE

Escape Formats Side by Side

The same three characters in every format.

Formaté (U+00E9)€ (U+20AC)😀 (U+1F600)
JavaScript / JSON\u00E9\u20AC\uD83D\uDE00
ES6 JavaScript\u{E9}\u{20AC}\u{1F600}
Python\u00E9\u20AC\U0001F600
HTML hexé€😀
HTML decimalé€😀
CSS\E9\20AC\1F600
Code pointsU+00E9U+20ACU+1F600
◐ THREE STEPS

How to Use the Unicode Escape

Get your result in under ten seconds.

1

Paste your text

Any language, symbols or emoji.

2

Choose a format

JavaScript/JSON, ES6, Python, HTML, CSS or U+ code points.

3

Copy the escapes

Pure ASCII output, safe in any file encoding.

✓ FEATURES

Why Use the Unicode Escape on Developers Web Tools

Fast, accurate and private — built for developers.

😀

Emoji-safe

Characters above U+FFFF get correct surrogate pairs or full code points.

7

Seven formats

JavaScript, JSON, ES6, Python, HTML hex/decimal, CSS and U+ lists.

Aa

Readable output

Escape only non-ASCII characters, or everything if you prefer.

\E9␣

CSS-correct

Adds the separating space CSS needs before hex digits and spaces.

⚡

Fast

Large texts are processed in a background thread.

🔒

Private

Runs entirely in your browser.

FAQ

Frequently Asked Questions

JavaScript and JSON \u escapes always have four hex digits, which only reach U+FFFF. Characters beyond that, like most emoji, are written as two escapes — a surrogate pair. \uD83D\uDE00 is one character, 😀. Use the ES6 format (\u{1F600}) for a single escape in modern JavaScript.

Yes. JSON uses the same \uXXXX escapes, including surrogate pairs, so the output can go straight into a JSON string. (Quotes and backslashes in your text aren't escaped by this tool — use the JSON Escape tool for a complete JSON string.)

Every character above U+007E (accented letters, symbols, other scripts, emoji) plus invisible control characters. Letters, digits, punctuation, spaces, tabs and line breaks stay as they are.

In CSS, a hex escape ends at the first non-hex character, and one space after it is swallowed. So \E9 t is “ét”, while \E9t would read the t as text but \E9a would read “E9A”. The tool adds the space only when needed.

It depends how it's stored. A precomposed é is one code point (U+00E9); an e followed by a combining accent is two (U+0065 U+0301). The tool escapes code points exactly as they are in your text.

No. Everything runs in your browser.