← All text tools

Unicode Escape Converter

Converts text to Unicode escape sequences and back for JavaScript, JSON, Java, Python, CSS and HTML, with emoji written as surrogate pairs where the language needs them.

  • Free
  • No sign-up
  • Works on any device

About Unicode Escape Converter

Source code, JSON files and web pages often need non-ASCII characters written as escape sequences. This tool converts text to the escape style of your language and back. In JavaScript, JSON and Java, é becomes \u00e9, and an emoji outside the Basic Multilingual Plane is written as a surrogate pair of two escapes, so 😀 is \ud83d\ude00. ES6 and Python allow one escape for any code point, \u{1f600} or \U0001f600. CSS uses \e9 and HTML uses é or é. Unescaping accepts all of these forms.

How to use Unicode Escape Converter

  1. Choose text to escapes, or escapes to text.
  2. Pick the style that matches your language and decide whether plain ASCII should stay as typed.
  3. Paste your text, then copy the result into your code or file.

Why use this tool?

Also known as

Frequently asked questions

How is an emoji written as a JavaScript escape?

As two escapes that form a surrogate pair. The grinning face U+1F600 is \ud83d\ude00, or \u{1f600} in ES6 code.

Should hex digits be uppercase or lowercase?

Both are valid and mean the same. JSON and JavaScript output usually uses lowercase, so lowercase is the default here.

Does JSON accept the curly-brace escape form?

No. JSON only allows the four-digit form with a backslash and u, so characters beyond U+FFFF must be written as a surrogate pair there.

Is Unicode Escape Converter free?

Yes. Unicode Escape Converter on Toolipedia is free to use, with no sign-up and no watermark.

Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.

Can I put Unicode Escape Converter on my own website?

Yes. Use the Embed on your site button under the tool to copy a short piece of code and paste it into your page. It is free, needs no account, and the tool keeps working inside your page.

Related tools