Text to Unicode: the answer in code points
This converter writes text as space-separated Unicode code points in hexadecimal with a U+ prefix. For example, Hello becomes U+0048 U+0065 U+006C U+006C U+006F. Switch to Unicode → Text to decode code points back into text.
By Hommer Zhao
Worked Examples: Outputs and Exact Errors
These results use the same codec as the widget above. Quoted input and decoded text show whitespace and lone surrogates as escapes. UTF-8 bytes are computed separately with TextEncoder and shown in uppercase hexadecimal.
ASCII word: Hello
typical · Input (Text → Unicode)
"Hello"
Output
U+0048 U+0065 U+006C U+006C U+006F
Code points shown: 5
UTF-8 hex bytes: 48 65 6C 6C 6F (5 bytes)
Why: Each letter gets its own code point. Letter case is preserved.
ASCII letter: A
typical · Input (Text → Unicode)
"A"
Output
U+0041
Code points shown: 1
UTF-8 hex bytes: 41 (1 bytes)
Why: The encoder pads hexadecimal values to at least four digits after the U+ prefix.
Euro sign: €
boundary · Input (Text → Unicode)
"€"
Output
U+20AC
Code points shown: 1
UTF-8 hex bytes: E2 82 AC (3 bytes)
Why: The code point identifies the euro sign. The UTF-8 bytes below encode that code point; the code point is not the byte sequence.
Outside the BMP: 😀
boundary · Input (Text → Unicode)
"😀"
Output
U+1F600
Code points shown: 1
UTF-8 hex bytes: F0 9F 98 80 (4 bytes)
Why: This code point is outside the Basic Multilingual Plane and needs five hexadecimal digits. padStart(4) only pads shorter values; it never truncates longer ones.
Precomposed letter: é
boundary · Input (Text → Unicode)
"é"
Output
U+00E9
Code points shown: 1
UTF-8 hex bytes: C3 A9 (2 bytes)
Why: The precomposed letter is one code point. Compare it with the following combining-accent example; the converter does not normalize either form.
Letter plus combining accent: é
boundary · Input (Text → Unicode)
"é"
Output
U+0065 U+0301
Code points shown: 2
UTF-8 hex bytes: 65 CC 81 (3 bytes)
Why: The letter and combining acute accent are two code points. They can look identical to the precomposed letter while preserving a different sequence.
Family emoji: 👨👩👧
boundary · Input (Text → Unicode)
"👨👩👧"
Output
U+1F468 U+200D U+1F469 U+200D U+1F467
Code points shown: 5
UTF-8 hex bytes: F0 9F 91 A8 E2 80 8D F0 9F 91 A9 E2 80 8D F0 9F 91 A7 (18 bytes)
Why: This family emoji contains five code points, including the Zero Width Joiners between the people. The encoder shows each code point separately.
Lone high surrogate
boundary · Input (Text → Unicode)
"\ud800"
Output
U+D800
Code points shown: 1
UTF-8 hex bytes: EF BF BD (3 bytes)
Why: The encoder emits the surrogate value without rejecting it, but decoding that output is rejected, as shown below. TextEncoder replaces a lone surrogate with the replacement character before producing UTF-8 bytes; those bytes do not encode the surrogate itself.
Decode U+ notation
typical · Input (Unicode → Text)
"U+0048 U+0065 U+006C U+006C U+006F"
Output
"Hello"
Why: Whitespace separates code points; the separators do not become spaces in the decoded text.
Decode bare hexadecimal
typical · Input (Unicode → Text)
"48 65 6C 6C 6F"
Output
"Hello"
Why: The U+ prefix and leading zero padding are optional when decoding.
Decode a lowercase prefix
typical · Input (Unicode → Text)
"u+0041"
Output
"A"
Why: The prefix and hexadecimal letters are case-insensitive.
Empty input
boundary · Input (Unicode → Text)
""
Output
""
Why: Empty input returns an empty result without an error in either direction.
Whitespace-only decode input
boundary · Input (Unicode → Text)
" \t\n"
Output
""
Why: Decoding whitespace-only input returns an empty result. Encoding whitespace instead preserves it as code points.
Rejected: a non-hex suffix
failure · Input (Unicode → Text)
"U+0041Z"
Error
"U+0041Z" is not a valid code point. Use hex like U+0041 or 1F600, separated by spaces.
Why: The entire token must be hexadecimal after the optional prefix. A valid leading portion does not make the token acceptable.
Rejected: above the Unicode range
failure · Input (Unicode → Text)
"U+110000"
Error
"U+110000" is out of the Unicode range (maximum is U+10FFFF).
Why: This token is hexadecimal, but its value exceeds the maximum Unicode code point, U+10FFFF.
Rejected: a surrogate code point
failure · Input (Unicode → Text)
"U+D800"
Error
"U+D800" is a surrogate code point (U+D800–U+DFFF) and is not a valid standalone character.
Why: Surrogate code points are rejected as standalone characters, even when the encoder emitted the value from a lone surrogate.
Rejected: a 0x prefix
failure · Input (Unicode → Text)
"0x41"
Error
"0x41" is not a valid code point. Use hex like U+0041 or 1F600, separated by spaces.
Why: Only the U+ prefix is optional syntax here. The x in a 0x prefix is not a hexadecimal digit, so this token is rejected.
Rejected: comma-separated code points
failure · Input (Unicode → Text)
"U+0048,U+0065"
Error
"U+0048,U+0065" is not a valid code point. Use hex like U+0041 or 1F600, separated by spaces.
Why: Commas are not whitespace, so this whole input is one invalid token. Separate code points with spaces, tabs or newlines.
Accepted Formats and Limits
- Decode format: hexadecimal tokens with an optional U+ prefix; both the prefix and hex letters are case-insensitive. Leading zeros are optional. Separate tokens with whitespace, including spaces, tabs and newlines.
- Validation: only hexadecimal digits may follow the optional prefix. Values above U+10FFFF and surrogate code points U+D800–U+DFFF are rejected. Commas, 0x prefixes, JavaScript escapes and HTML entities are not accepted.
- Empty input: empty input returns an empty result. Whitespace-only decode input also returns an empty result; encoding preserves whitespace as code points.
- Length: no length limit is enforced by this widget or its codec.
- Browser processing: the interactive conversion runs locally in the browser. The codec makes no network requests.
Common Mistakes
- A code point is not a UTF-8 byte: € is
U+20AC, encoded asE2 82 AC(3 bytes). - Precomposed é (
U+00E9) and e plus a combining acute accent (U+0065 U+0301) can look identical; this converter does not normalize them. - A ZWJ family emoji contains several code points:
U+1F468 U+200D U+1F469 U+200D U+1F467, including joinersU+200D. - U+ notation differs from JavaScript
\uescapes and HTML&#x…;entities; this decoder accepts neither syntax. - A lone surrogate encodes as
U+D800, but decoding that output fails: "U+D800" is a surrogate code point (U+D800–U+DFFF) and is not a valid standalone character.
To work with UTF-8 bytes in binary, use Text to Binary or Binary to Text. For a Base64 representation of text, use the Base64 Encoder.
What Is Unicode?
Unicode is the universal standard for encoding text in computers. It assigns a unique numerical identifier — called a code point — to characters across the world's writing systems, plus technical symbols, mathematical notation, musical notation, and emoji. As of Unicode 16.0 (2024) it defines about 154,998 characters, making it possible to represent text from virtually any language in a single consistent encoding.
Code points are written in the format U+XXXX, where XXXX is a hexadecimal number. The basic Latin letter A is U+0041, the Greek letter alpha is U+03B1, the Chinese character for "water" is U+6C34, and the thumbs-up emoji is U+1F44D. The full range extends from U+0000 to U+10FFFF, providing space for over 1.1 million characters.
The Problem Unicode Solves
Before Unicode, the computing world was fragmented across dozens of incompatible character encoding standards. ASCII covered only English. ISO 8859-1 added Western European languages. Shift_JIS handled Japanese. GB2312 handled Chinese. Each standard could represent only a subset of the world's writing systems, and text encoded in one standard would display as garbled characters (mojibake) on systems using a different standard.
Unicode solved this by creating a single, comprehensive encoding that encompasses all characters from all writing systems. A document encoded in Unicode can seamlessly mix English, Chinese, Arabic, Hindi, emoji, and mathematical symbols without any encoding conflicts. This universality is why Unicode has become the default text encoding on the modern web and in modern operating systems.
Unicode Encodings: UTF-8, UTF-16, UTF-32
Unicode code points are abstract numbers — the actual binary representation used to store and transmit these numbers is defined by Unicode Transformation Formats (UTFs). UTF-8 is the dominant encoding on the web, used by over 98% of websites. It uses 1 to 4 bytes per character and is backward-compatible with ASCII. UTF-16 is used internally by Windows and Java, using 2 or 4 bytes per character. UTF-32 uses a fixed 4 bytes per character, which is simpler but less space-efficient.
Unicode Planes and Blocks
Unicode organizes its code points into 17 planes, each containing 65,536 code points. Plane 0 (U+0000 to U+FFFF) is the Basic Multilingual Plane (BMP), containing the most commonly used characters from all modern writing systems. Plane 1 is the Supplementary Multilingual Plane, containing emoji, musical symbols, and historical scripts. Plane 2 contains additional CJK (Chinese/Japanese/Korean) ideographs. Planes 3-13 are largely unassigned, reserved for future use.
Working with Unicode in Programming
Modern programming languages provide native Unicode support. In JavaScript, String.fromCodePoint(0x1F600) creates the grinning face emoji, and "A".codePointAt(0) returns 65. Python 3 strings are Unicode by default: ord('A') returns 65 and chr(0x4E16) returns the Chinese character for "world." Understanding Unicode is essential for internationalization (i18n), proper text handling, emoji processing, and avoiding encoding bugs that can corrupt data.
Emoji and Special Characters
Emoji are full Unicode citizens with assigned code points, typically in the Supplementary Multilingual Plane (U+1F000 and above). Some emoji are composed of multiple code points joined by Zero Width Joiners (U+200D) — for example, the family emoji can be a sequence of individual person emoji joined by ZWJ characters. Skin tone modifiers (U+1F3FB through U+1F3FF) and gender modifiers add further complexity to the emoji system.