What it does
This is a text-to-code-point converter. It reads the characters in your text and writes each one as a Unicode notation: a U+ number, an HTML entity, a JavaScript escape, or a UTF-16 code unit. The reverse direction accepts those notations and rebuilds the original text, including accents and emoji.
The name “ASCII to Unicode” is a common search phrase, but the useful distinction is between readable text and a representation that survives a context where the literal character does not. HTML entities belong in HTML, JavaScript escapes belong in source code, and U+ notation belongs in documentation and debugging. The converter picks the representation; it does not change the underlying text encoding of the page.
Notations
The same letter A can be written as U+0041, A, A, \u0041, 0x0041, or 65. These are different conventions for the same code point. An accented é is U+00E9. The emoji 🌍 is U+1F30D — one code point, but two UTF-16 code units and four UTF-8 bytes.
JavaScript and UTF-16 output use surrogate pairs for characters above U+FFFF. That is why a single emoji can produce two escapes. The decoder recognizes a high surrogate followed by a low surrogate and joins them. It refuses a lone surrogate rather than producing a broken character that looks fine in one editor and fails in another.
Skipping and line breaks
“Leave ASCII characters readable” keeps the first 128 code points as literal characters and only encodes the non-ASCII ones. It is the quickest way to document a few special characters in an otherwise plain sentence. The output is mixed by design: readable letters, escaped symbols. Turn it off when you need a uniform sequence that a parser can consume.
By default, line breaks are encoded too, because a line break is a character. “Keep line breaks as line breaks” preserves the visual structure of a multi-line input. That makes the result easier to read, but a strict decoder may treat the literal newline as a separator rather than data. Choose based on whether a human or a machine is the next reader.
Examples
Before
Hello 🌍
CaféAfter
U+0048 U+0065 U+006C U+006C U+006F U+0020 U+1F30D
U+0043 U+0061 U+0066 U+00E9The space is U+0020 and the line break is not shown here because this example uses the newline-preserving option. The emoji stays one code point; the accented é is U+00E9. If you choose JavaScript output, the emoji becomes a surrogate pair instead.
Before
Hello 🌍
CaféAfter
Hello 🌍
CaféThe ordinary letters remain readable and only the special characters become entities. In an HTML document, the browser resolves the entity back to the character. In a plain text file, it stays as literal notation. That difference is why the destination matters.
Before
\uD83C\uDF0DAfter
🌍Two UTF-16 code units become one astral character. The decoder also accepts \u{1F30D} and U+1F30D, which express the same character as a single code point.
Limits worth knowing
- Code points are not grapheme clusters. A family emoji joined with zero-width joiners is several code points that render as one picture. Encoding it produces several numbers, not one. The tool preserves the sequence, but it does not collapse it into a single symbol.
- HTML entities are context-sensitive. Encoding text as entities does not make it safe to inject into an HTML attribute, a script block, or a URL. Use the escaping rules for the exact context, not a general converter.
- Malformed input is rejected. A lone surrogate, a value above U+10FFFF, or stray prose in the code box produces an error. The decoder does not skip unknown characters silently.
- It is not encryption. Encoding is a public, reversible representation. Anyone can decode it. Use the Encryption Generator when confidentiality is the goal.
- Very large inputs are still limited by the tab. Encoding creates several characters per input character, so a large document produces a much larger output. Work in excerpts if the page becomes sluggish.
Page updated