I Help You

Unicode Escape Generator

Convert text to \uXXXX Unicode escape sequences and decode them back. Free, and it runs entirely in your browser — nothing you enter is uploaded.

How to use the Unicode Escape Generator

1. Choose Escape to convert Unicode characters to escape sequences, or Unescape to decode them.

2. Select the escape format: \\uXXXX (JavaScript strings), \\u{XXXXX} (ES6 / modern JS), or U+ (Unicode notation).

3. Paste your text and copy the escaped result.

What is it?

Unicode escape sequences represent non-ASCII characters using only ASCII characters. This is essential when embedding special characters, emoji, or non-Latin scripts in contexts that only accept plain ASCII — like certain configuration files, JSON payloads in older systems, C/Java string literals, or environments where copy-pasting Unicode might corrupt the file.

There are three common formats: \\uXXXX is the classic JavaScript format (4-digit hex, using surrogate pairs for characters above U+FFFF). \\u{XXXXX} is the modern ES6+ format that supports any Unicode code point directly. U+XXXX is the standard Unicode notation used in documentation and specifications. All three formats are fully decoded by the unescape mode.

Example

Text with emoji and accents (Encode → \\u format)
Hello 👋 café
↓
Unicode Escaped
Hello \uD83D\uDC4B caf\u00E9

Emoji use surrogate pairs (\\uD83D\\uDC4B). Use \\u{1F44B} in modern ES6+ JS to represent emoji directly.

Benefits

Embed non-ASCII characters safely in source code strings

\uXXXX escape sequences work in Python, JavaScript, Java, and C# without encoding issues in files or terminals.

Debug Python and Java Unicode escape errors

See the exact \uXXXX sequence for any character to trace the source of unicode decode errors and encoding exceptions.

Prepare strings for ASCII-safe JSON and config files

Escaped Unicode sequences pass through ASCII-only channels without corruption — safe in .properties, .yaml, and .env files.

Embed emoji and symbols in config files that don't support full Unicode

Use escape sequences to include any Unicode character in files that may not be saved or transmitted in UTF-8.

Frequently asked questions

What are surrogate pairs?

Unicode characters above U+FFFF (like emoji and many rare symbols) cannot fit in a 4-digit hex \u escape. The classic \uXXXX format uses two consecutive 16-bit values (a high surrogate and a low surrogate) to represent them. The modern \u{XXXXX} format avoids this by accepting any code point directly.

Why does ASCII text pass through unchanged?

ASCII characters (code points 0–127, the standard English letters, digits, and common punctuation) are already in the basic character set of virtually every encoding. They don't need escaping, so they are passed through as-is to keep the output readable.

What format should I use for JavaScript?

For modern JavaScript (ES2015+), use \u{XXXXX} — it's cleaner and handles emoji without surrogate pairs. For older JavaScript or JSON, use \uXXXX (with surrogate pairs for emoji). For documentation or reference, use U+ notation.