Text to Unicode Converter
Convert text to Unicode codepoints (like U+1F600 or \uXXXX) and back, with a detailed character-by-character analysis.
| Character | Codepoint | Decimal | Category | UTF-8 Bytes | UTF-16 |
|---|
Characters exceeding U+FFFF, such as emoji or rare Hanja, are stored as surrogate pairs in JavaScript, occupying two UTF-16 code units. Choosing JavaScript format displays these characters as two code units, while ES6 or Unicode standard format displays them as a single codepoint. This tool iterates through codepoints, ensuring emoji are not split and are accurately converted and restored. You can see the actual composition in the UTF-16 column of the detailed table below.
In the Code โ Text direction, the tool automatically recognizes U+ notation, JavaScript escapes, ES6 brace notation, HTML decimal (😀) and hexadecimal (😀) entities, and named entities (♥), regardless of the selected format.
What is the Text to Unicode Converter?
Ever wondered about the identity of a broken character (โก), special symbol (ยฉ), or emoji (๐)? This tool converts text into the unique numbers computers understandโUnicode codepointsโand vice versa. It's essential for developers embedding characters in code, or for designers and writers needing to safely display special characters on the web. More than just a converter, it provides a detailed analysis of every character, breaking it down into its codepoint, UTF-8 bytes, and Unicode category. With seven output formats like JavaScript (\uXXXX) and HTML (&#...;) and a "Keep ASCII as-is" option for readability, you get the exact code you need. And since all conversions happen in your browser, your data remains completely private.
How to use
- Paste or type text into the "Input (Text or Code)" box on the left.
- The conversion direction is set to "๐ Auto-detect" by default, automatically handling text or code. You can also force a direction with "Text โ Code" or "Code โ Text".
- When converting text to code, select your desired "Format", such as "\uXXXX โ JavaScript (Surrogate Pairs)" or "&#NNNN; โ HTML Decimal". Check "Keep ASCII as-is" to leave plain text readable.
- The result appears instantly in the right panel. Click the "Copy" button to use it.
- Below the result, examine stats like "Characters (Codepoints)" and a full "Character Details" table breaking down every single character in your input.
Text to Unicode Converter guide
How this tool is used in real work, and what to watch out for.
Why an Emoji Can Count as Two Characters
In JavaScript, `"๐".length` evaluates to 2. This isn't a bug; it's due to how strings are stored. JavaScript strings are UTF-16, and each UTF-16 code unit can only hold values up to U+FFFF. Characters beyond that, like most emoji, are stored in two code units called a "surrogate pair."
This is why the tool's stats show both "Characters (Codepoints)" and "UTF-16 Length" side by side. If your text includes an emoji, these two numbers will differ by one, and the "Surrogate Pairs" counter will show you how many such characters there are.
| Character | Codepoint | UTF-16 | Codepoints / UTF-16 Length |
|---|---|---|---|
| A | U+0041 | 0041 | 1 / 1 |
| ํ | U+D55C | D55C | 1 / 1 |
| ๐ | U+1F600 | D83D DE00 (pair) | 1 / 2 |
Catching Invisible Characters
If you're sure you typed something correctly but search or string comparison fails, you might have an invisible character hiding in your text. Paste the problematic string into the tool and scan the Codepoint and Category columns in the character details table to expose the culprit.
| Character | Codepoint | Common Sources |
|---|---|---|
| Non-breaking space (NBSP) | U+00A0 | Copying from web pages, Word, or Excel. Causes syntax errors when pasted into code. |
| Zero-width space | U+200B | WYSIWYG editors and translation tools. Completely invisible. |
| BOM (Byte Order Mark) | U+FEFF | The start of a file. A frequent cause of JSON parsing failures. |
| Variation Selector | U+FE0F | Appended to an emoji to request a specific presentation (e.g., colorful). |
| Left-to-right/Right-to-left Mark | U+200E, U+200F | Documents with mixed scripts, like Arabic or Hebrew. |
The 7 Formats: When to Use Each One
When you change the format, the separator automatically switches to the conventional choice for that format. For example, `\u0041\u0042` is typically written without spaces, while `U+0041 U+0042` is written with them. Your own separator choice is preserved if you change it after the automatic switch.
Checking "Keep ASCII as-is" leaves English letters and numbers readable while escaping only Hangul, emoji, and special characters. This is the most practical combination for creating strings to embed in code.
| Format | Example Result (๐) | Where to Use It |
|---|---|---|
| \uXXXX โ JavaScript | \uD83D\uDE00 | JS string literals, legacy codebases |
| \u{XXXXX} โ ES6 | \u{1F600} | Modern JS; the codepoint is readable |
| U+XXXX โ Unicode Standard | U+1F600 | Referring to a character in documents, issues, or chats |
| &#NNNN; โ HTML Decimal | 😀 | HTML body, email templates |
| &#xHHHH; โ HTML Hexadecimal | 😀 | Same as above, but makes the codepoint visible |
| HTML Named Entities | & ยท ♥ etc. | Only for known symbols. Falls back to hex if none exists. |
| Decimal Codepoint | 128512 | When you just need the number |
Decomposed Hangul โ A Normalization Issue
If you unzip a file from macOS on Windows, you might see the characters in Korean filenames break apart. This happens because the same Hangul character, "ํ๊ธ" (Hangeul), can be stored in two ways. The precomposed form (NFC) uses a single codepoint per syllable, while the decomposed form (NFD) uses multiple codepoints for the initial, medial, and final consonants and vowels (*jamo*).
You can use this tool to determine which form you have. Paste the problematic text and look at the character count and the Category column.
- If you see "Hangul Syllable" (U+AC00โU+D7A3) and the character count for "ํ๊ธ" is 2, it's precomposed (NFC). This is the standard form.
- If you see multiple "Hangul Jamo" (U+1100โU+11FF) and the character count is 6, it's decomposed (NFD). This is the form macOS filesystems use.
- If you see "Hangul Compatibility Jamo" (U+3130โU+318F), it means the letters were typed individually (like ใฑ and ใ on a keyboard), which is different from both NFC and NFD.
Decoding vs. Auto-Detection
When converting from Code โ Text, the tool recognizes all known notations, regardless of the selected format. You can mix `U+D55C`, `\uD55C`, `\u{D55C}`, `한`, `한`, and `♥` in the same input.
However, auto-detection only identifies the input as code if prefixed notations (like `U+` or `\u`) cover the entire string. It won't automatically decode something like "D55C AE00" because that could just be plain text.
- To decode prefix-less code, you must manually select the "Code โ Text" direction.
- If your values are hexadecimal, keep the format set to a hex-based option like JavaScript or U+XXXX.
- To decode decimal codepoints (like 54620), you must change the format to "Decimal Codepoint" to make the tool read them as base-10 numbers.
Frequently asked questions
Can this tool handle emoji?
Yes, perfectly. Emoji like ๐ are correctly converted to their codepoints (U+1F600) and back. The tool properly handles surrogate pairs, and the "Character Details" table even shows the UTF-16 structure.
Is my input text data secure?
Absolutely. This tool operates 100% within your web browser. No text you enter is ever sent to our servers, so you can safely convert sensitive or private information without any privacy concerns.
Which output format should I choose?
Use "&#...;" (HTML Decimal/Hex) for web pages, `\uXXXX` for JavaScript or JSON strings, and `U+XXXX` for technical documentation. The tool's format names suggest their common uses.
What does "Keep ASCII as-is" do?
It prevents standard English letters, numbers, and symbols from being converted. For text like 'Hello ยฉ 2024', only 'ยฉ' is escaped, leaving the rest readable. It's great for code legibility.