Unicode Text Converter for UTF-8, UTF-16, UTF-32
This Unicode text converter is built for the everyday debugging work around characters, code points, and encoded text.
Related tools
About the Unicode Text Converter
The Unicode Text Converter transforms text between multiple Unicode representations — Unicode escape sequences, HTML entities, code point notation, UTF-8 hex bytes, and plain text. Use it to encode special characters for source code, HTML templates, JSON strings, and regex patterns, or to decode escape sequences back to readable text.
How to Use
- Paste your text or escape sequences into the input field.
- Select the conversion direction: text to Unicode escapes, or Unicode escapes to text.
- Choose the output format: JavaScript/JSON
\uXXXXescapes, Python\UXXXXXXXXescapes, HTML numeric entities (XXXX;), CSS Unicode escapes (\XXXX), or raw code point values (U+XXXX). - Click Convert and copy the output.
Unicode Escape Formats
Different languages and formats use different conventions for embedding Unicode characters as escape sequences:
- JavaScript / JSON —
\uXXXXfor BMP characters (U+0000–U+FFFF). Supplementary characters use a surrogate pair:😀for 😀 (U+1F600). ES6 added\u{1F600}syntax to avoid surrogate pairs. - Python —
\uXXXXfor BMP characters;\UXXXXXXXX(8 hex digits) for supplementary characters. Python 3 strings are Unicode natively, so escapes are only needed in byte literals or regex patterns. - HTML numeric entities — Decimal (
€) or hexadecimal (€) for the Euro sign (€). Named entities like&or©are supported for common characters. - CSS Unicode escapes —
\XXXXfollowed by optional whitespace. Used incontent:declarations and@font-faceglyph ranges. Example:\2764for ❤. - Java —
\uXXXX(4 hex digits). Supplementary characters require two\uescapes forming a surrogate pair, same as JavaScript. - C / C++ —
\uXXXX(4 hex digits) or\UXXXXXXXX(8 hex digits) in string literals. Supported in C99 and C++11 and later.
Unicode Code Point Notation
Unicode code points are written as U+ followed by 4–6 hex digits. Common ranges:
- U+0000–U+007F — ASCII. The first 128 code points match ASCII byte values.
- U+0080–U+00FF — Latin-1 Supplement. Accented characters, currency symbols (€ is U+20AC, not in this range).
- U+0100–U+024F — Latin Extended A and B. Covers most European languages.
- U+0400–U+04FF — Cyrillic.
- U+0600–U+06FF — Arabic.
- U+4E00–U+9FFF — CJK Unified Ideographs (core Han characters).
- U+1F300–U+1F9FF — Emoji and pictographic symbols (supplementary plane).
Common Unicode Conversion Issues
- Surrogate pairs in JavaScript — Emoji and supplementary characters in JavaScript strings are stored as two UTF-16 code units.
"😀"and"\u{1F600}"both represent 😀, butstr.lengthreturns 2 for the surrogate pair form. Use the ES6 spread orArray.from()to get the correct character count. - Mixed entity formats in HTML — Mixing named entities (
&) with numeric entities (&) is valid but inconsistent. Parsers handle both, but tools that process HTML as text may not expand numeric entities unless explicitly configured. - Case sensitivity in hex digits — Unicode escapes are case-insensitive in most contexts (
éandéare equivalent), but some validators or linters enforce a specific case. Check your style guide. - CSS escape termination — A CSS Unicode escape ends at 6 hex digits or at the first non-hex character. If the character immediately following the escape is a hex digit, insert a space to terminate the escape:
\E9 aencodeséa, not U+00E9A. - JSON string escaping — JSON requires
\uXXXXescapes for control characters (U+0000–U+001F). Characters above U+FFFF must use surrogate pairs in strict JSON; some parsers accept the ES6\u{...}extension.
Frequently Asked Questions
- What is the difference between a code point and a code unit?
- A code point is a Unicode abstract character number (e.g., U+1F600 for 😀). A code unit is the unit of storage in a specific encoding: 1 byte in UTF-8, a 16-bit value in UTF-16, a 32-bit value in UTF-32. Supplementary characters like emoji require one code point but two UTF-16 code units (a surrogate pair) or four UTF-8 code units.
- How do I find the code point for any character?
- Paste the character into this tool and select "to code point" output. Alternatively: in JavaScript,
"😀".codePointAt(0).toString(16)→1f600. In Python,ord("😀")→128512, thenhex(128512)→0x1f600. In the browser DevTools console, the same JavaScript expression works instantly. - Why do some characters appear as boxes or question marks?
- A box (☐) or replacement character (U+FFFD,
?) means the font does not contain a glyph for that code point, or the text was decoded with the wrong encoding. Install a Unicode-complete font (Noto, Symbola) for the missing script, or verify the encoding used to read the source data. - What is a grapheme cluster and why does it matter?
- A grapheme cluster is what users perceive as a single character — it may consist of multiple code points. For example,
écan be a single code point (U+00E9) or two (e + U+0301 combining acute accent). String length operations count code points, not grapheme clusters. Use ICU or language-specific Unicode segmentation libraries when counting user-visible characters.
Understanding ASCII and Unicode
Passwords are like underwear: you don’t let people see it, you should change it very often, and you shouldn’t share it with strangers.