Keeping source code ASCII-only
Escaping the non-ASCII characters lets a string containing accents or emoji live in a file that must remain plain ASCII.
Convert text into Unicode escape sequences in your browser, handling characters above the basic plane.
Maintained by Roshan.
Converts text to escaped in this tab, with nothing sent anywhere.
Find related browser-local tools for nearby tasks without starting another search.
Browse all developer and data toolsA Unicode escape sequence writes a character as a code like backslash-u followed by its hex code point, and it exists for the places where a raw character cannot safely appear. Source code that must stay pure ASCII, a JSON string being embedded somewhere fussy, a config file whose encoding you do not trust: in all of them, escaping the non-ASCII characters sidesteps the question of whether the file's encoding will survive. The subtlety that trips up naive tools is characters above the basic multilingual plane - emoji, some scripts, rarer symbols - which do not fit in the four-hex-digit form and are stored internally as two halves. A tool that escapes each half produces sequences that decode to broken characters. This one walks the text by code point and uses the longer brace form for those characters, so they round-trip correctly.
Escaping the non-ASCII characters lets a string containing accents or emoji live in a file that must remain plain ASCII.
When you are not sure the destination preserves UTF-8, escaping the risky characters avoids the question entirely.
Because they are above the basic plane and do not fit the four-digit form. The brace form holds the longer code point and decodes correctly.
No. Printable ASCII is left alone; only non-ASCII characters are escaped.
Yes, through the unicode unescape tool, because high characters use the correct longer form.
It uses the common backslash-u convention, including the brace form for high code points that modern JavaScript supports.
Convert Unicode escape sequences back into readable characters in your browser.
Encode text as HTML entities in your browser so it displays as text instead of being interpreted as markup.
Convert text to hexadecimal in your browser. Each character becomes its UTF-8 bytes in hex.