Text to Unicode code points — U+ numbers and escapes, both ways

Paste any text to list each character's Unicode code point, as U+1F600 or as a JavaScript, Python or HTML escape, or switch direction to turn those codes back into characters.

Live demo · real result from this tool
Direction

Result

U+0048 U+0069 U+0020 U+1F600

Processed on your device — nothing is uploaded.

How to use the text to Unicode converter

  1. Choose the Direction: Text → code points or Code points → text.
  2. When encoding, pick a Format: U+0048, \u0048 (JavaScript, JSON), \u{48} (ES2015), \u0048 / \U0001F600 (Python), H (HTML hex), H (HTML decimal) or 0x0048.
  3. Type or paste into Your text.
  4. 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 \20AC are not recognised here.
  • \u codes must have exactly four hex digits; use the braces form or U+ for longer numbers.

Frequently asked questions

What is a code point?
It is the number Unicode gives a character, written as U+ followed by at least four hex digits. A is U+0041, é is U+00E9 and the grinning face emoji is U+1F600. The number stays the same in every font, app and language.
Why does an emoji become two \u codes in JavaScript format?
JavaScript and JSON strings store text in 16-bit units. Characters above U+FFFF, which includes most emoji, need two of them, called a surrogate pair. So U+1F600 becomes \uD83D\uDE00. The ES2015 format writes it as one code instead.
Can I decode text that mixes formats?
Yes. The decoder finds U+, \u, \u with braces, Python \U, HTML hex and decimal references, and 0x codes anywhere in the input, even mixed together. Words between the codes are kept, and spaces that only separate codes are dropped.
Why does an emoji with a skin tone give several codes?
Many emoji are built from more than one code point, for example a base emoji plus a skin-tone modifier, or several people joined by an invisible joiner (U+200D). The tool lists every code point, so you can see how the emoji is made.
Which format should I use in a web page?
Use the HTML hex or HTML decimal format. A reference such as € shows the euro sign in any browser, whatever encoding the file was saved in. The \u formats are for strings in program code, such as JavaScript, JSON or Python.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close