Hello
Unicode Escape Sequences Explained
Unicode escape sequences let you represent any character by its numeric code point, useful when the character isn't typable, when you need to avoid encoding issues, or when embedding in code/HTML. The most common format is \uXXXX (4 hex digits), used in JavaScript, Java, Python, and JSON. For characters above U+FFFF, JavaScript uses \u{XXXXX} with 1–6 hex digits. HTML uses &#xXXXX; or &#DDDD; (decimal).
Decoding Various Escape Formats
This tool decodes: JavaScript \u0048 and \u{1F600}; literal backslash-u \\u0048 (when the string was double-escaped); HTML hex entities H and 😀; legacy URL %u0048 and %u1F600. Paste mixed content and the tool will identify and decode each format. Invalid sequences are left as-is. Decoding is useful when debugging API responses, parsing logs, or converting between systems.
Encoding for Different Languages
When encoding, choose the format for your target: JavaScript/JSON uses \uXXXX (and \u{...} for astral); Python uses \uXXXX or \U0001F600 (8 digits for astral); HTML uses &#xXXXX;; CSS uses \XXXX; Java uses \uXXXX. Some formats require surrogate pairs for characters above U+FFFF (e.g., Java). The tool generates the correct representation for each.
Common Use Cases
Use this tool when: debugging why a string displays as \uXXXX in logs; converting escaped strings from APIs to readable text; preparing strings for embedding in code or HTML; handling legacy data with %uXXXX encoding; comparing how different systems represent the same character. All processing runs in your browser — no data is sent to a server.
Frequently Asked Questions
Related Tools
Explore More Tools
Find this tool useful? Buy us a coffee to keep DuskTools free and ad-light.