Unicode Converter
Convert text to/from \uXXXX, ES6, &#x;, &# and \xHH escapes, with full surrogate-pair and astral code-point support.
How to use
Purpose
Online Unicode converter that translates any character (CJK, Emoji, special symbols) to Unicode code points (U+XXXX), JavaScript escapes (\uXXXX), HTML entities (&#xXXXX;), UTF-8 byte sequences, and UTF-16 byte sequences. Reverse-decodes \u4e2d\u6587-style escapes back to readable text. Common for debugging encoded JSON, generating Emoji code points, JavaScript string literal encoding, and HTML compatibility. All conversion runs locally.
Steps
- Paste or type a string on the left (with CJK / Emoji / any character)
- Switch display on the right: Unicode code point (U+4E2D), JS escape (\u4e2d), HTML entity (中), UTF-8 hex, UTF-16 hex
- Reverse: paste \u4e2d\u6587 to auto-decode as 中文
- Emoji mode: correctly handles surrogate pairs (🎉 = \uD83C\uDF89)
- Toggle decimal / hexadecimal display
- Case: U+4E2D (uppercase default) or u+4e2d (lowercase)
- Batch processing: one string per line
FAQ
- Why do Emoji need two \u escapes in JS strings?
- Characters outside BMP (most Emoji, rare CJK, extended Latin) have code points above 0xFFFF, requiring a UTF-16 surrogate pair. e.g. 🎉 (U+1F389) = \uD83C\uDF89. Modern JS supports \u{1F389} (ES2015+) or just writing the literal Emoji (clearest).
- Is Unicode the same as UTF-8?
- No. Unicode is the character set (assigning U+XXXX to each character). UTF-8 is one encoding (mapping code points to bytes). The character "中": Unicode code point U+4E2D, UTF-8 bytes E4 B8 AD, UTF-16 bytes 4E 2D.
- Why is my JSON full of \u escapes for Chinese?
- Python json.dumps defaults to ensure_ascii=True, escaping all non-ASCII. Java ObjectMapper, Go json.Marshal behave similarly. ASCII-only JSON is safer for transport (no charset negotiation), but unreadable. Decode here to restore.
- Do I need 中 HTML entities for Chinese?
- Usually no. Modern HTML5 uses UTF-8 — write 中 directly. You need entities when: 1) the doc charset is GBK / ISO-8859-1; 2) HTML email (some clients have weak charset negotiation); 3) you want to be explicit about an invisible character (zero-width space).
- Rare or ancient CJK characters do not display — what to do?
- Some rare characters live in Unicode Plane B/C/D (U+20000+) and system fonts may not cover them. The tool emits the code point so you can check font support. Common workarounds: replace with images, use SVG glyphs, or ensure users have an extended-coverage font (e.g. Source Han Sans).
Use cases
- Triage JSON Chinese encoding: decode \u escapes back to readable text
- Generate JS string literals: literals with Emoji or special chars portable across runtimes
- HTML email compatibility: convert CJK to HTML entities for legacy clients
- Unicode character lookup: reverse Emoji to U+XXXX code points
- Legacy system bridges: round-trip strings between GBK / GB2312 and Unicode
Use cases
JSON Chinese decode, JS Emoji literals, HTML email compatibility, Emoji lookup, GBK bridges. Frontend, backend, email marketing, localization engineers. Correct surrogate-pair handling, UTF-8/UTF-16 byte display, and multi-format conversion are the differentiators.