Text to Unicode (And the Three Different Lengths)
One emoji is 1 codepoint, 2 UTF-16 code units and 4 UTF-8 bytes
About Text to Unicode — Free Online Tool
Text to Unicode converts between text and codepoints in eight notations, and reports the three different lengths — codepoints, UTF-16 code units and UTF-8 bytes — that are all called "length" somewhere.
Encodes to U+, \u, CSS, HTML decimal and hex, UTF-8 bytes, UTF-16 units and plain decimal. Decodes all of them, including mixed input, and refuses values above U+10FFFF.
Each character is mapped to its code point in the page. The text is not transmitted.
Finding a character’s codepoint, escaping text for JSON or CSS, debugging a mojibake problem, and understanding why an emoji counts as two.
Also known as: unicode converter · codepoint converter · text to codepoints · character to unicode · string to unicode escape
When to use it
Because the same character has a different spelling in JSON, CSS, HTML and documentation, and because the character counts that software reports disagree with each other.
How it works
Text is read as a sequence of codepoints and re-expressed in the chosen notation. Decoding accepts every notation it can emit, mixed together if need be.
Three Numbers, All Called Length
An emoji is ONE codepoint, TWO UTF-16 code units, and FOUR UTF-8 bytes. JavaScript’s .length gives you the second; a database column limit is usually the third; what a reader would call a character is the first, and sometimes fewer still. All three are reported here, because the gap between them is behind a whole class of bugs: a 20-character limit that rejects a 12-character name, a truncation that cuts a character in half, a progress bar that overshoots.
Why An Emoji Breaks String Slicing
Everything above U+FFFF is stored in UTF-16 as a surrogate PAIR — two code units that mean one character. So "😀".length is 2, slicing a string at an odd position can leave half a surrogate pair, and the result renders as a replacement box. Any code that counts or truncates user text with .length will eventually do this. The fix is to iterate the string, which gives codepoints, rather than index into it.
The Same Character, Two Spellings
"é" can be one codepoint (U+00E9) or two (e followed by U+0301, a combining acute). Both render identically and neither is wrong. They compare as unequal, sort differently, and have different lengths — which is why a search fails on a name that is visibly right, and why Unicode normalisation exists. This tool counts combining marks and says when it found them, which is usually the moment the mystery resolves.
Decoding Is Where The Ambiguity Lives
U+0041, \u0041, \u{1F600}, A and A are all unambiguous and all accepted, mixed if necessary. A bare list of numbers is NOT unambiguous: 65 66 67 could be decimal codepoints or hexadecimal ones. It is read as decimal only when nothing else matched, and refused outright above U+10FFFF, which is the highest codepoint there is. A list of U+ tokens is treated as one string, with the separators dropped as notation rather than kept as spaces.
How to Use Text to Unicode in 4 Easy Steps
Follow this simple guide to process your files in seconds directly inside your browser tab.
Paste or Type Your Text
Enter your text content into the Text to Unicode workspace. A converter between characters and the numbers behind them, in whichever notation the thing you are pasting into expects.
Select Transformation Action
Choose the desired mode, delimiters, or transformation rules. Because the same character has a different spelling in JSON, CSS, HTML and documentation, and because the character counts that software reports disagree with each other.
Instant String Processing
The client-side engine processes your content with Text to Unicode immediately inside browser memory.
Copy or Export Result
Copy the updated text with one click or export it directly into your document or editor.
Why Use Text to Unicode on ShortTrick
Engineered for maximum speed, strict privacy, and frictionless digital productivity.
Live Real-Time Analysis
Word counts, character stats, and transformations in Text to Unicode update dynamically as you type.
Unicode & Multilingual Support
Text to Unicode accurately handles words and characters across international alphabets, emojis, and symbols.
One-Click Clipboard Export
Cleanly copy transformed text or remove duplicate entries with a single click.
Private Draft Processing
Confidential manuscripts, emails, and articles stay strictly in local memory while using Text to Unicode.
Frequently Asked Questions About Text to Unicode
Common questions regarding Text to Unicode, data privacy, file format compatibility, and usage limits.
Popular Searches & Related Tasks for Text to Unicode
Common search phrases, secondary format tasks, and workflows users reach for when using this tool.
Direct Variations & Search Synonyms (8)
Specific Workflows & Long-Tail Queries (15)
Semantic Standards & Technical Entities (20)
Related Text & Content Tools & Popular Utilities
Explore complementary browser-based tools with zero file uploads and instant in-memory execution.
More Text & Content Tools
Popular Tools Across Other Categories
Related Reading & Tutorials
Guides, articles, and best practices for text & content workflows.
