piko

Unicode Escape

Convert text to JavaScript and JSON-style Unicode escape sequences.

Runs on your device. Nothing you add is uploaded.

Result
Caf\u00e9 \u2615 \ud83d\ude00

How to use Unicode Escape

  1. Enter the text you want to escape.
  2. Turn on Escape ASCII characters too to encode every code unit.
  3. Copy the result as the contents of a quoted string.

Questions

Why does some emoji produce two escapes?
A four-digit escape represents one UTF-16 code unit. Characters above U+FFFF need two units called a surrogate pair.
Does the output already include quotes?
The result contains just the string contents. Add outer quotes if you are pasting it into JSON.

How this works

Converts UTF-16 code units to four-digit Unicode escapes in your browser.

Everything happens in this browser tab. What you type or add stays on your device, and the page has no tracking. Your last settings are kept in this browser so the tool opens the way you left it. Privacy