Appearance

Unicode Converter

/unicode-converter/

Related tools

Comments

0/500

About this tool

Where you run into Unicode escape sequences

Sometimes a JSON response shows \uD64D\uAE38\uB3D9 where Korean text should be, or a page's source contains characters written as numbers like 가. Both are ways of writing Unicode code points. Escapes like these are used when a file or channel can only carry ASCII safely, or when you want to put a specific character into a string in source code without any ambiguity.

Read moreShow less

This Unicode converter turns text into four notations: the JS/JSON escape \uXXXX, the U+XXXX form used in Unicode documentation, the HTML hexadecimal entity &#xXXXX; and the decimal entity &#NNNN;. In the other direction it turns text containing any mix of those notations back into characters. It is handy for building translation files, reading garbled logs, or checking how an emoji is stored in a database.

Code points and UTF-16 surrogate pairs in the Unicode converter

Unicode assigns a number to every character, from U+0000 to U+10FFFF, a range of 1,114,112 positions; that number is the code point. The 11,172 precomposed Korean Hangul syllables sit in order from U+AC00 (가) to U+D7A3 (힣), and each position can be calculated from the numbers of its initial consonant, vowel and final consonant as 0xAC00 + (initial × 21 + vowel) × 28 + final. The syllable 홍 is ㅎ (18), ㅗ (8) and final ㅇ (21), so (18 × 21 + 8) × 28 + 21 = 10829, and adding that to 0xAC00 gives U+D64D.

Strings in JavaScript, Java and JSON use UTF-16 internally. A UTF-16 unit is 16 bits, so characters up to U+FFFF fit in one \uXXXX, but anything above must be split into two units, a surrogate pair. For 😀 (U+1F600), subtract 0x10000 to get 0xF600, split it into the high 10 bits and low 10 bits, and add them to 0xD800 and 0xDC00, giving \uD83D\uDE00. That is why '😀'.length is 2 in JavaScript, and why 👍🏻 with a skin tone, made of two code points and four UTF-16 units, comes out as \uD83D\uDC4D\uD83C\uDFFB.

HTML entities write the code point directly regardless of UTF-16, so 😀 is a single 😀 or 😀. The tool reads text by code point and splits into surrogate pairs only for the JS format; the other formats use one notation per code point. Decoding finds \uXXXX, the ES6 form \u{1F600}, U+XXXX, &#xXXXX; and &#NNNN; even when mixed in one sentence, converts each to its character and leaves everything else alone.

Choosing the right Unicode format

For strings going into JavaScript or Java source or a JSON file, choose \uXXXX. The default, Non-ASCII only, leaves English letters, digits and spaces alone and converts only Korean and other symbols, so '한글 OK' reads as \uD55C\uAE00 OK. All characters converts spaces and letters too, as \u0020 or \u004F, which helps when you want to expose invisible characters or rule out encoding problems entirely.

For HTML or XML documents, use &#xXXXX; or &#NNNN;. They prevent broken characters when you insert symbols into email templates or older content management systems whose page encoding you cannot be sure of. U+XXXX is the notation used in Unicode references and font tools to identify a character, so it lists every character separated by spaces for checking code points one by one. Copy copies the whole output.

Common misconceptions and limits

A character that looks like one glyph on screen is not guaranteed to be one code point. When Korean text is stored in decomposed NFD form, as in file names created on a Mac, the syllable 한 comes out as three code points, U+1112, U+1161 and U+11AB, and converts to \u1112\u1161\u11AB. If the result is longer than expected, the source may contain decomposed Hangul. Skin tones, flags and family emoji are also several code points combined, so they produce several notations.

When decoding, a \u followed by fewer than four hex digits, an unpaired surrogate such as a lone \uD83D, or a value above U+10FFFF is treated as invalid, and the line and column are reported. Named entities such as & and < are left as they are, and other escapes like \n or \t are not processed. Escaping is only a notation, not encryption, so it cannot be used to hide anything. Conversion happens only in this browser; the input, options and the last 5 entries under Recent are kept in this browser's localStorage, and Reset and Clear remove them.

FAQ

What are \uAC00 and 가 used for?

\uXXXX represents a character inside JavaScript, JSON or Java strings, while &#xXXXX; and &#NNNN; are used inside HTML and XML documents. Both point to the same character 가 (U+AC00), and 가 is the same number written in decimal.

Why does an emoji turn into two \u escapes?

JS strings are UTF-16, so characters above U+FFFF are written as two code units, a surrogate pair. 😀 (U+1F600) is \uD83D\uDE00. As an HTML entity it is a single 😀, and the \u{1F600} form can also be decoded.

How do I turn \uD64D escapes in JSON back into readable text?

Choose Decode and paste the text as it is. \uD64D\uAE38\uB3D9 becomes 홍길동, and anything that is not an escape stays unchanged.

Why do I get three codes for a single Korean character?

The source Hangul is in decomposed NFD form, split into its letters. This often happens with text copied from Mac file names or some documents. Precomposed Hangul gives one code per syllable.

Are named entities like & converted?

No. Only numeric entities such as 가 are converted; named entities are left as they are.

Is my input saved or sent anywhere?

Nothing is sent to a server; conversion runs only in the browser. The input, options and the last 5 entries are kept in this browser's localStorage so you can pick up where you left off, and Reset and Clear remove them.