Unicode Converter

Convert text to Unicode escapes

About Unicode Converter

Unicode Converter writes every character of your text as a \uXXXX escape, the form used in JavaScript, JSON, and Java string literals, and turns escapes back into text. To Unicode escapes all characters, plain ASCII letters included, in lowercase hex; a character above U+FFFF, such as the emoji 😀, becomes two escapes (a UTF-16 surrogate pair), while ☕ (U+2615) takes one. From Unicode reads \uXXXX, the ES2015 form \u{1F600}, and U+1F600 code points, and leaves any other text as it is. It does not produce UTF-8 bytes or HTML entities, and needs no server.

Example

A letter, an accented letter, and an emoji escaped with To Unicode, then three escape styles read with From Unicode:

Input

Aé😀

\u0041 \u{1F600} U+00E9

Result

To Unicode: \u0041\u00e9\ud83d\ude00

From Unicode: A 😀 é

How to convert text to \uXXXX escapes

  1. 1Paste text, or escapes such as \u00e9, \u{1F600}, or U+00E9.
  2. 2Click "To Unicode" to escape every character, or "From Unicode" to turn escapes back into text.
  3. 3Copy the line with "Copy"; "Download" writes it to converted.txt.

Formats and limits

To Unicode output
One \uXXXX per UTF-16 code unit, lowercase hex, no separators
Read by From Unicode
\uXXXX; \u{…} with one to six hex digits; U+ (capital U) followed by four to six hex digits
Not handled
UTF-8 bytes (see Hex to Text) and HTML entities (see HTML Entity Decoder)

Where your text is processed

Both buttons run a short script inside this page: your text is not sent to a server and is not saved. The converter has no error messages of its own; if the page fails, for instance when the browser refuses a copy, we receive the error, the tool's name, and your browser's name and version, never the text you pasted.

Frequently asked questions

How many \u escapes does an emoji take?

Two for emoji above U+FFFF, such as 😀 (\ud83d\ude00), which JavaScript stores as a surrogate pair; one for older emoji in the basic plane, such as ☕ (\u2615). From Unicode joins a pair back into one character.

Can it read \u{1F600} or U+1F600?

Yes. Besides \uXXXX, From Unicode reads the ES2015 \u{…} form and U+ code points with four to six hex digits. A lowercase u+ is not recognized and stays as typed.

Does To Unicode escape plain letters too?

Yes. Every character is escaped, ASCII included, so A becomes \u0041 and the whole output is plain ASCII. Paste only the characters that need escaping if you want ordinary letters to stay readable around them.

Is this the same as UTF-8?

No. \uXXXX numbers are UTF-16 code units: é is \u00e9, while its UTF-8 bytes are c3 a9. To see or decode bytes, use Hex to Text.

Tips and tricks

  • ✓The output of To Unicode can go inside a JSON string, where \uXXXX escapes are valid as they are.