Overview
Converting text to Unicode means representing each character by its numeric code point instead of the character itself โ useful for embedding special characters in code, debugging encoding issues, or working with systems limited to ASCII input. This article walks through the conversion and decoding process.
What You Need
- The text you want to convert (any characters, including emoji or non-Latin scripts)
- Knowledge of which output format you need:
\uXXXXescapes,U+XXXXnotation, or HTML entities
Steps
Identify which representation you need.
\uXXXXis used in JavaScript, Java, and C# string literals;U+XXXXis the Unicode Standard's reference notation; HTML entities (&#xXXXX;) are used in HTML markup.Enter your text into the Unicode Text Converter. The Unicode Text Converter processes your input character by character (technically, by Unicode code point) and shows all formats simultaneously.
Copy the specific format you need. Each output โ Unicode Escape, U+ Notation, HTML Entity, Decimal Code Points, and UTF-8 Hex Bytes โ has its own copy button.
To decode instead, paste the escaped string into the same input. The converter automatically detects
\uXXXX,U+XXXX, and HTML entity patterns and shows the decoded readable text.Check the result for multi-byte characters. Characters outside the common range (many emoji, some non-Latin scripts) may show as a pair of escapes rather than one โ this is expected and reflects how the character is actually stored internally.
Common Mistakes to Avoid
- Mixing up escape formats between programming languages โ
\uXXXXworks in JavaScript and Java, but some languages use different escape syntax entirely; check your target language's documentation if the output doesn't work as expected. - Assuming one character always equals one
\uXXXXescape โ characters outside the Basic Multilingual Plane (many emoji) require two escapes (a surrogate pair), not one. - Manually looking up code points character by character โ this is slow and error-prone for anything longer than a single character; convert the whole string at once instead.
Formula & Methodology
Each character is processed by its Unicode code point:
- Unicode Escape (
\uXXXX): 4-digit hexadecimal code point, or a surrogate pair for code points above U+FFFF - U+ Notation:
U+followed by the hexadecimal code point - HTML Entity:
ollowed by the hexadecimal code point, then;
Worked example โ converting the Euro sign "โฌ" (code point U+20AC):
- Unicode Escape:
\u20ac - U+ Notation:
U+20AC - HTML Entity:
€ - Decimal:
8364