Free online Unicode encoder/decoder. Convert between Chinese/Japanese characters and \uXXXX format for i18n debugging.
TL;DR: Free Unicode encoder/decoder for \uXXXX surrogates, \u{code points}, U+ notation, and UTF-8 \xHH bytes, with length metrics and a code-point breakdown.
For local tools, open DevTools → Network and search your input — it should not appear in requests.
Next steps
Usage Guide
Unicode escapes are a common way JSON, Java source, and some configs represent non-ASCII characters. This tool converts both ways across several escape forms and shows UTF-16 unit, code-point, and UTF-8 byte lengths plus a per-character breakdown — entirely in your browser.
1. Encode and decode
Encoding walks Unicode scalar values, not charCodeAt alone. BMP characters need one \u; supplementary-plane characters become a surrogate pair in JSON-style mode. Switch to \u{…} or U+ when you want the real code point visible.
- Pick a format: \uXXXX (surrogate pairs), \u{XXXXX} (code points), U+XXXX, or UTF-8 \xHH.
- Text → escapes: type readable characters on the left (including emoji), click encode; astral characters become high+low surrogates in \uXXXX mode.
- Escapes → text: paste mixed forms on the right (pairs, U+, \xHH), click decode; lone surrogates and invalid UTF-8 raise clear errors.
2. Unicode vs UTF-8 vs ASCII — keep them straight
Shortest debug path: confirm the transport is UTF-8, then the database is utf8mb4, then inspect source escapes. This tool covers "what character does this escape represent?" and where the three length metrics diverge. For the full comparison, see the ASCII vs Unicode vs UTF-8 guide.
- Unicode is the character map (code points). UTF-8 / UTF-16 encode those points as bytes. \uXXXX is an ASCII-safe writing of UTF-16 code units.
- JSON may carry raw UTF-8 Chinese or \u escapes — same meaning, different size and readability.
- Mojibake (� / boxes) usually means bytes were decoded with the wrong charset, not that \u itself is broken.
3. Where it fits
Limits: HTML entities and percent-encoding belong in the HTML entity and URL tools. Do not paste half of a surrogate pair — the decoder errors instead of silently emitting half a character.
- Reading log lines or packet captures where Chinese JSON fields were escaped.
- Comparing text to a hex dump via UTF-8 \xHH output.
- Confirming the exact code point of an emoji or rare symbol so you do not paste lookalikes.
- Diffing two "identical looking" strings via the code-point table or escape dump.
FAQ
Neither — the page works as soon as it opens. Encoding and decoding run locally, and your text never leaves this device.
Four encode outputs: \uXXXX (UTF-16 surrogates, common in JSON), \u{XXXXX} (full code points), U+XXXX code-point lists, and UTF-8 \xHH bytes. Decoding accepts a mix of these forms and reports clear errors on lone surrogates or invalid UTF-8. HTML entities are out of scope — use the HTML entity tool on this site.
Whenever non-ASCII text like Chinese or emoji misbehaves: recover the original behind \uXXXX / \u{…} escapes, compare UTF-8 bytes, see the difference between UTF-16 unit length and code-point length, or debug Unicode escapes inside JSON.
No. It converts faithfully between code points, escape sequences, and characters — it doesn't guess or fix a wrong source encoding. If mojibake came from a bad encoding guess, identify the original encoding first. NFKC-style normalization is likewise outside the default promise.
Most emoji code points exceed a single UTF-16 unit, so they must be written as a surrogate pair — the two escapes together are one character, not a bug. It's also a common reason a string's length comes out larger than the visible character count. Confirm the shape with a short sample before processing long text.
Related Tools
Related Articles
Online Unicode Encoder/Decoder: Handle Unicode Character Conversion
Learn Unicode encoding and decoding principles. Understand UTF-8, UTF-16, and escape sequences, and how to convert code points, surrogate pairs, and UTF-8 bytes online.
Online Base64 Encoder and Decoder Tools Compared (2026)
Comparing 4 popular online Base64 tools across Unicode safety, privacy, batch capability, and cost: RapidTables goes broad, Browserling does batch, ToolVault runs locally — each has its place. Includes the btoa trap, base64url variants, and reproducible verification methods.
Online HTML Entity Encoder/Decoder: Safely Handle Special Characters
Learn HTML entity encoding fundamentals. Understand how to convert special characters to HTML entities, prevent XSS attacks, and use encoding in frontend development.