Text tool

Unicode Text Converter

Inspect, transport, or restore UTF-16 text with explicit escape syntax, predictable surrogate-pair behavior, and no upload.

In-browser processingNo account requiredPrivacy details ↗

Maximum 100,000 UTF-16 characters. Conversion stays in this browser; encoded output is limited to 500,000 characters.

The escape prefix remains lowercase \u in both styles.

Every UTF-16 code unit becomes one four-digit escape; supplementary characters such as emoji become a surrogate-pair sequence.

A QUICK WALKTHROUGH

How to use this tool

  1. Choose text-to-escapes or escapes-to-text and enter up to 100,000 UTF-16 characters.
  2. For encoding, choose lowercase or uppercase hexadecimal digits; for decoding, correct any identified malformed escape.
  3. Convert locally, review the exact result, then copy it or download a text file.

Four hexadecimal digits per UTF-16 unit

Encoding emits one lowercase \u followed by exactly four hexadecimal digits for every browser UTF-16 code unit, including ASCII letters, spaces, punctuation, and line breaks. Choose lowercase or uppercase hexadecimal letters. Supplementary characters such as many emoji use two surrogate code units and become two adjacent escapes. This matches JavaScript \uXXXX string-literal units; it does not emit code-point braces such as \u{1F44B}.

Strict decoding with visible failures

Decoding replaces every exact lowercase-u \uXXXX sequence, including sequences embedded in ordinary text. A backslash-u prefix without four following hexadecimal digits stops with its UTF-16 position instead of being silently retained. Other text and backslash sequences remain unchanged. Isolated surrogate escapes are preserved as the exact UTF-16 code units they represent, so callers that require Unicode scalar values should supply paired surrogates.

GOOD TO KNOW

Common questions

Why does one emoji become two escapes?

The browser stores supplementary Unicode characters as a UTF-16 surrogate pair. This converter intentionally emits one four-digit escape per UTF-16 code unit.

Does decoding require the entire input to be escaped?

No. Exact \uXXXX sequences can appear inside ordinary text; only those sequences are replaced. Other text remains in place.

Does this support \u{1F44B} or \x48?

No. The scope is the classic four-digit lowercase-u form \uXXXX. Braced code-point and two-digit byte escape syntaxes are outside this converter.