InTab

Unicode Escape

Encode and decode JSON or XML text to Unicode escapes (\uXXXX, &#x…;).

Encoders: Escape, encode and decode text. It runs in your browser, so nothing you enter is uploaded.

What it does

The Unicode Escape tool converts text to escape sequences and back. It supports the formats used by JSON and JavaScript (\uXXXX), ES6 (\u{XXXXX}), Python, CSS, XML and HTML character references (&#NNNN; and &#xXXXX;) and plain code points (U+XXXX). It can escape only non-ASCII characters, or everything.

How to use it

  1. Paste text, JSON or XML into Text / JSON / XML, or click Load sample.
  2. Choose the Format.
  3. Choose the Scope: Non-ASCII only, All chars in string values / text (which leaves JSON keys and XML tags readable), or Every character.
  4. Copy the Escaped result. Paste escaped text into the right-hand side to decode it.

Example

Text: Café ✓ 😀

Format Result
JSON / JavaScript Caf\u00E9 \u2713 \uD83D\uDE00
ES6 Caf\u{E9} \u{2713} \u{1F600}
XML / HTML hex Café ✓ 😀

Good to know

  • Characters outside the Basic Multilingual Plane, such as emoji, become a surrogate pair (two \u escapes) in JSON and older JavaScript.
  • Escaping makes files safe for systems that only accept ASCII, such as some older databases, log pipelines and .properties files.
  • For HTML special characters such as < and &, the HTML Entities tool is a better fit.

FAQ

Why does my JSON show \u00E9 instead of é? Some serializers escape all non-ASCII characters. Paste the JSON here to decode it into readable text.

Is escaped JSON still valid JSON? Yes. \uXXXX escapes are part of the JSON standard.

More Encoders tools

  • Base64: Encode and decode Base64 text and files (URL-safe supported).
  • Image to Base64: Turn an image into a Base64 data URL, raw Base64, CSS, HTML or Markdown.
  • Base64 to Image: Paste Base64 or a data URL to see the image and download it.
  • URL Encoder: Percent-encode and decode URLs; parse URL parts and query parameters.
  • HTML Entities: Escape and unescape HTML entities.
  • JWT Encoder / Decoder: Decode, verify and sign JSON Web Tokens: HS, RS, PS, ES and EdDSA, with key generation.