Unicode Escape Encoder
Convert every UTF-16 unit into a four-digit Unicode escape. Encode letters, line breaks and emoji, preview surrogate pairs, and copy the result.
Use this result well
- Inputs that matter
- Text or four-digit Unicode escape sequences, with Unicode Escape and the intended Encode/Decode direction selected.
- Output to expect
- Four-digit UTF-16 escapes or the decoded text, including surrogate pairs for characters such as emoji.
- How it works
- Encoding writes each UTF-16 unit as a four-digit escape. Decoding replaces those escapes once; ordinary text remains in place.
- Escape conventions vary between JSON, JavaScript and other formats. This view does not parse an entire source document.
- Keep the original text when exact emoji, combined characters or line endings matter.
- Text input is limited to 2,000,000 UTF-16 units and each result to 20,000,000. Large conversions can be cancelled or retried.
- Chains allow up to 12 steps. Intermediate previews are shortened; Copy retains the complete final result.
Related Tools
Tools you might need next
Decode four-digit Unicode escapes into text, including emoji surrogate pairs. Inspect one decoding pass and copy the result without running code.
Encode UTF-8 text with RFC 4648 standard or URL-safe Base64 and an explicit padding policy, with strict errors and no encryption claim.
Percent-encode one Unicode URI component with encodeURIComponent semantics, explicit context limits, and malformed UTF-16 rejection.
Reference & details
How it works
Updated September 2026
How it works
Updated September 2026Four hexadecimal digits per unit
Each UTF-16 unit is written as a backslash, a lowercase u and four hexadecimal digits, with leading zeros when needed.
Surrogate pairs
Supplementary characters retain both original UTF-16 units. Decoding the emitted pair reconstructs the original character.
Format context
The view emits escapes without adding string delimiters or parsing a program. Check the syntax expected by the destination format.
Updated: September 2026
Example Scenarios
See that ASCII and non-ASCII text both receive escapes.
→ \u0041\u4e2d
Encode a character that needs two UTF-16 units.
→ Two four-digit escapes, representing UTF-16 units D83D and DE00.
Encode the backslash and each following character in literal text.
→ \u005c\u0075\u0030\u0030\u0034\u0031
FAQ
About Unicode Escape Encoder
Convert all entered text into four-digit Unicode escapes, including ordinary ASCII letters. Each UTF-16 unit becomes one escape; emoji outside the basic range use a surrogate pair. The page opens with Unicode Escape and Encode selected.