Loona Automation logoLoona Developer Tools
Home › Encoders & Decoders

Text to Unicode Escape Sequences

In short: convert any text to \uXXXX escape sequences — the form JSON strings, JavaScript, Java and .properties files use when only ASCII is allowed. Emoji and other astral characters become surrogate pairs.
🔒 Private by design: everything runs in your browser on this device. Your input is never uploaded to a server.

Example

Input:

café ☕

Output:

caf\u00e9 \u2615

About this converter

Escape sequences let ASCII-only formats carry any character: each character becomes \u followed by four hex digits of its code point. Characters above U+FFFF (most emoji) do not fit in four digits, so UTF-16-based languages write them as a surrogate pair — two escapes that together name one character — and this converter does the same, matching what JSON parsers and Java actually expect. You meet this format in Java .properties files, older JSON payloads from Java services, Windows registry exports and internationalisation files where a build pipeline cannot be trusted with raw UTF-8.

Frequently Asked Questions

Why did one emoji become two escapes?

It lives above U+FFFF, so UTF-16 writes it as a surrogate pair: a high surrogate (D800–DBFF) plus a low surrogate (DC00–DFFF). Parsers recombine them automatically.

Is \u escaping the same as percent-encoding?

No — different worlds. \uXXXX belongs to string literals in code and JSON; %XX belongs to URLs.

Which characters are left unescaped?

Plain printable ASCII passes through untouched (except backslash and quote, which are escaped so the result stays valid inside a string).

Related Developer Tools

Embed this tool on your website — free

Add this tool to your own website or blog — it is completely free, needs no sign-up, and always shows the latest version. Copy the code below and paste it into your page where you want the tool to appear. Keeping the small “Powered by Loona Automation” credit line under the embed helps keep this tool free — but you are free to style or remove it; the tool works either way.