toolqik

82 · Encode & Convert

Unicode Encoder & Decoder

Convert text to \uXXXX, \u{…}, &#x…; or U+ escapes for any language, and decode them back.

Runs in your browser
Mode
Options
Result

  

About this tool

Every character has a Unicode code point, a number written U+00E9 for é or U+1F44B for 👋. Programming languages and markup let you write characters by number using escape sequences, which is useful when a file or system only accepts ASCII, or when a character is invisible or easy to confuse. This tool converts text to escapes in the style your language uses, and decodes any of them back to text.

Escape styles

Styleé👋
JavaScript, JSON, Java, C#\u00E9\uD83D\uDC4B (surrogate pair)
ES6 JavaScript, Swift, Rust\u{E9}\u{1F44B}
Python, C, C++\u00E9\U0001F44B
HTML / XMLé or é👋
CSS (content:)\E9\1F44B
Unicode notationU+00E9U+1F44B

Why some emoji need two escapes

JavaScript, JSON and Java store strings as UTF-16, where characters above U+FFFF (most emoji, many CJK ideographs) take two 16-bit units called a surrogate pair. That is why 👋 is \uD83D\uDC4B in JSON, and also why "👋".length is 2 in JavaScript. Newer syntaxes (\u{…}, Python’s \U) write the code point directly.

Decoding

Paste text containing any mix of \uXXXX, \u{…}, \UXXXXXXXX, \xXX, &#…; and U+…; each is replaced by its character. The table below the result lists every non-ASCII character with its code point, escapes and UTF-8 bytes, which helps you spot invisible characters such as zero-width spaces.

FAQ

How do I convert text to Unicode escapes?

Paste the text and choose your language’s escape style. Non-ASCII characters are replaced with escapes like \u00E9; turn on “Escape every character” to escape everything.

How do I decode \u escapes?

Switch to “Escapes → text” and paste. \uXXXX, \u{…}, \U, \x, HTML numeric references and U+ notation are all decoded.

What is a Unicode code point?

The number assigned to a character in the Unicode standard, written U+ followed by hex digits. For example, A is U+0041 and € is U+20AC.

Why is an emoji two \u escapes in JSON?

JSON and JavaScript use UTF-16, where characters above U+FFFF are stored as a surrogate pair of two 16-bit units.

What is the difference between Unicode and UTF-8?

Unicode assigns each character a number (code point). UTF-8 is one way of storing those numbers as bytes. Use the UTF-8 encoder to see the bytes.

esc
↑↓ navigate↵ open