🌐 Unicode Escaper/Unescaper - Multi-format Unicode

🎯
⚙️
ℹ️
:
Pattern:
Example:
📝
📤
📊
Total: chars
ASCII:
Unicode:
Unique:
Escapes:
Encoding:
🔍
⚡
⚠️

ℹ️ About Unicode Escaper/Unescaper

Unicode escaping converts characters such as é, 東京, and 😀 into text-safe escape sequences for source code, data files, markup, stylesheets, and URLs. Unicode assigns each character a code point such as U+00E9 or U+1F600; formats then serialize those code points as JSON \u escapes, Python \U escapes, CSS hexadecimal escapes, numeric HTML/XML character references, or UTF-8 percent-encoded bytes.

Use this Unicode escape and unescape tool when debugging mojibake, preparing international text for JSON fixtures, checking emoji surrogate pairs, converting character references copied from HTML, or comparing how different programming languages represent the same non-ASCII text.

Supported escape formats:

  • JSON/JavaScript: \uXXXX escapes defined for JSON strings in RFC 8259 and for ECMAScript string literals in ECMA-262.
  • Python: \uXXXX for Basic Multilingual Plane characters and \UXXXXXXXX for code points above U+FFFF.
  • Java: \uXXXX UTF-16 code-unit escapes, including surrogate-pair output for supplementary characters.
  • CSS: hexadecimal escapes such as \1F600 , where the trailing space can terminate the escape before the next hexadecimal character, as described by CSS Syntax Level 3.
  • HTML/XML: numeric character references such as 😀 or 😀; HTML parsing behavior is defined by the WHATWG HTML Standard.
  • URL: UTF-8 byte percent encoding such as %F0%9F%98%80, separate from language-level Unicode escapes and based on URI/URL escaping rules in RFC 3986.

Examples:

  • é becomes \u00E9 in JSON/JavaScript and é as a hexadecimal HTML reference.
  • 😀 becomes \uD83D\uDE00 in UTF-16 based formats, \U0001F600 in Python, and %F0%9F%98%80 in URL percent encoding.
  • line\nbreak and other control-character sequences are easier to inspect after escaping, but they still need context-aware validation before use in code or markup.

Unicode has a few sharp edges. Supplementary characters above U+FFFF may be stored as two UTF-16 surrogate code units; isolated high or low surrogates are not valid Unicode scalar values and can fail when copied into strict JSON, XML, or database layers. Escaping also does not normalize text: é can be one precomposed code point or e plus a combining accent, which compare differently unless normalized with rules such as Unicode Standard Annex #15.

The authoritative character model and code charts come from The Unicode Standard and the Unicode code charts. Escaping is not the same as sanitizing: HTML entities, JavaScript escapes, and URL percent encoding must be chosen for the exact output context, and sensitive text remains sensitive after conversion.

API Usage Example:

POST /api/tools/encoding-decoding/unicode
Content-Type: application/json

{
    "text": "héllo 🌍",
    "operation": "escape",
    "format": "json"
}
Ready