How to use the text to Unicode converter
- Choose the Direction: Text → code points or Code points → text.
- When encoding, pick a Format:
U+0048,\u0048(JavaScript, JSON),\u{48}(ES2015),\u0048 / \U0001F600(Python),H(HTML hex),H(HTML decimal) or0x0048. - Type or paste into Your text.
- Copy the Result. The U+ and 0x formats put a space between codes; the escape formats run together so they can go straight into code.
What it does and when to use it
Two characters can look identical and still be different, such as a Latin a and a Cyrillic а, or a normal space and a no-break space. Listing the code points shows exactly what is in a string. That is useful when a search or a password fails for no visible reason, when you need to type a symbol into source code without pasting it, or when you want an HTML reference that survives any file encoding.
For the plain decimal numbers of English text, text to ASCII codes is simpler. For the bytes a file actually stores, see the binary converter. To look up the name of a character, try the Unicode character lookup, and for CSS escapes the Unicode escape encoder has extra formats.
How it works
Encoding. The text is read one code point at a time, so an emoji counts as one character. Each number is written in upper-case hex, padded to at least four digits for U+, 0x and \u. Two formats differ: JavaScript format splits characters above U+FFFF into a surrogate pair, and Python format switches to \U with eight digits for them.
Decoding. The tool searches the input for every known form. Neighbouring \uXXXX codes that make up a surrogate pair are joined back into one character. Any value above U+10FFFF, the top of Unicode, is rejected with a message. If nothing recognisable is found, the tool lists the forms it accepts. It all runs in your browser.
Worked examples
Results from the tool:
Hi 😀 U+0048 → U+0048 U+0069 U+0020 U+1F600
😀 JavaScript → \uD83D\uDE00
é😀 Python → \u00E9\U0001F600
Price: U+20AC 5 (decode) → Price: € 5
In the first line the space shows up as U+0020. The second shows the surrogate pair behind one emoji. The third uses Python’s short form for é and the long form for the emoji. In the last, the words around the code are kept and U+20AC becomes the euro sign.
Limits and tips
- The decoder reads only the forms listed above. CSS escapes such as
\20ACare not recognised here. \ucodes must have exactly four hex digits; use the braces form or U+ for longer numbers.
Frequently asked questions
What is a code point?
Why does an emoji become two \u codes in JavaScript format?
Can I decode text that mixes formats?
Why does an emoji with a skin tone give several codes?
Which format should I use in a web page?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.