Unicode Escape Encoder & Decoder
Encode text as \uXXXX, \xXX, or HTML hex entities, and decode escaped strings back to readable text for code, JSON, and config work.
What is this tool?
This Unicode escape encoder and decoder translates text into escape notations used by JavaScript, JSON-like examples, HTML snippets, logs, and byte-level debugging. It supports \uXXXX Unicode escapes, \xXX byte escapes, and hexadecimal HTML entities.
The \uXXXX format reflects UTF-16 code units. Characters outside the Basic Multilingual Plane, such as many emoji, are represented as surrogate pairs rather than a single four-digit escape. The hex mode works from UTF-8 bytes, so non-ASCII characters may become multiple \xXX sequences.
Use it to read escaped strings from logs, prepare code examples, or verify how a character is represented before pasting it into a parser, template, or configuration file.
How to use
- Choose the escape format: Unicode
\uXXXX, byte-style hex\xXX, or HTML hexadecimal entity syntax. - Use Encode for readable text and Decode for existing escape sequences.
- Paste the content, run the conversion, and copy the result.
- When decoding produces an empty result, switch formats or verify that the input uses complete escape sequences.
Examples
| Input / setting | Output | Notes |
|---|---|---|
Hi | \u0048\u0069 | Unicode escape mode encodes each BMP character as \uXXXX. |
Hi | \x48\x69 | Hex mode encodes the UTF-8 bytes for ASCII characters. |
\u0048\u0069 | Hi | Unicode escape mode decoded back to readable text. |
A | A | HTML hexadecimal entity mode decoded to a character. |
Related tools & concepts
Last reviewed: 2026-05-08