Text to Unicode
Parse and convert text to unicode and vice-versa
About Text to Unicode
Converts text into HTML numeric character references (Hi for Hi) and back. This is one way to write any character in an HTML or XML document using only ASCII.
When you would use it
- Embedding special characters, symbols or non-Latin text in an HTML file or e-mail template that must stay pure ASCII.
- Decoding a string of &#...; references found in page source or a data export.
- Lightly obscuring an e-mail address in a web page so simple scrapers do not read it.
How to use it
- To encode, type text in the first field and read the &#...; sequence below it.
- To decode, paste a sequence of &#...; references in the second field and read the text.
- Copy the result.
Things worth knowing
- Every character is encoded, including plain letters and spaces, so the output is much longer than the input. Browsers render it identically.
- The references are decimal code points (€ for the euro sign). Hexadecimal references (€) are equivalent in HTML but are not produced or decoded here.
- Characters outside the Basic Multilingual Plane, such as most emoji, are encoded as two surrogate references (for example ��). Browsers display them correctly, but they are not the character's single code point.
- This is not encryption or a security measure. Anyone can decode it, and most scrapers do.
Frequently asked questions
- Is this the same as the Unicode code point U+XXXX?
- Related but not identical: the number after &# is the decimal code point for characters up to U+FFFF. For emoji and other supplementary characters this tool emits two surrogate numbers instead of the single code point.
- When should I use references instead of typing the character?
- Only when the file cannot be saved as UTF-8 or passes through a system that corrupts non-ASCII text. In a UTF-8 document, typing the character directly is simpler and more readable.