Encode or Decode Unicode Escapes

Turn characters into JavaScript-style `\uXXXX` escape sequences, or decode a string of those escapes back to text. Encode is the default. Hex digits are lowercase unless you turn on uppercase. Each UTF-16 code unit becomes a four-digit escape.

This tool runs in your web browser: your files and text are processed on your device and are not uploaded to TidyKit servers. Free, no sign-up.

How to convert

1. Paste the text or the escapes. 2. Choose encode or decode. 3. Copy the result.

`Hi!` encodes to `\u0048\u0069\u0021`. Decoding that string returns `Hi!`.

Privacy and limits

The conversion stays in this tab. Encoding uses 16-bit code units, so a character outside the Basic Multilingual Plane is represented as two escapes (a surrogate pair). Decode looks for `\u` followed by four hex digits; other escape styles are not converted.

Frequently asked questions

Is the text uploaded?

No.

Can I get uppercase hex?

Yes. Turn on the uppercase option when encoding.

Does this handle emoji or other supplementary characters?

They are encoded as two `\u` escapes, one for each half of the UTF-16 surrogate pair.

Will it decode `\xHH` or `U+XXXX`?

No. Only the `\uXXXX` form is decoded.

More Text Tools