devpocket.dev

Unicode Escape Converter

Escape or decode ten Unicode formats, validate surrogate pairs and inspect individual code points.

Runs locally
Loading tool…

How to use

  1. Choose Escape, paste text and select an output format. Enable Escape all characters or Lowercase hex when needed. Controls and syntax markers remain escaped even in non-ASCII mode.
  2. Choose Unescape to convert Unicode to text. Auto-detect accepts mixed formats; select a specific format when literal text resembles another syntax.
  3. Inspect each code point and its zero-based UTF-16 offset below. Invalid surrogates report their source offset; enable replacement to substitute U+FFFD.
  4. Copy or download the result. Output contains escape fragments, not quoted string literals. Only options persist; your text stays in memory.

FAQ

How does a \u escape converter handle UTF-16 surrogate pairs?

JS/JSON and Java encode 🚀 as \uD83D\uDE80. ES6 uses \u{1F680}; Python uses \U0001F680. Lone UTF-16 surrogates are rejected with their source offset or replaced with U+FFFD when requested. Scalar formats never combine surrogate values into a pair.

What do C hex escapes and URL percent escapes represent?

Both formats represent UTF-8 bytes here: é is \xC3\xA9 or %C3%A9, not \xE9. C hex escapes consume all following hex digits, so adjacent ASCII hex digits are also escaped. Invalid UTF-8 is rejected. URL decoding preserves + as a plus sign; it is not form decoding.

Are HTML entity code points interpreted like a web browser?

This is strict numeric Unicode conversion, not HTML parsing: decimal and hexadecimal references require semicolons and valid scalar values. Browser-specific control-character remapping and named entities are not applied. For named HTML entities use HTML Entities & Unicode.

How is this different from text-to-binary and string escaping?

This tool focuses on Unicode escape fragments, mixed-format detection, strict surrogate diagnostics and a paginated code-point inspector. String Escape & Bytes covers text-to-binary and quoted language literals. U+ list whitespace is escaped to distinguish text spaces from list separators. No Unicode name database is downloaded.

Related tools