Unicode Escape

Convert non-ASCII characters to Unicode escape sequences (\uXXXX). Keep ASCII text readable while escaping everything else.

Your data never leaves your browser

How to Use

  1. 1

    Paste your text

    Enter text containing non-ASCII characters (accented letters, CJK, Cyrillic, emoji, etc.).

  2. 2

    Click Escape

    Non-ASCII characters are replaced with \uXXXX sequences. ASCII characters remain unchanged.

  3. 3

    Copy the result

    Click Copy to copy the escaped text for use in code or config files.

What is Unicode Escape?

Unicode escape converts non-ASCII characters into \uXXXX escape sequences (or \u{XXXXX} for characters above U+FFFF like emoji). ASCII characters (code points 0–127) are left as-is for readability.

This is useful when you need to embed international text in source code, JSON strings, or configuration files that only support ASCII. Characters above U+FFFF (like emoji) are encoded as surrogate pairs (\uD83C\uDF0D) for full JSON compatibility. It's also helpful for debugging encoding issues β€” you can see the exact code points of every character.

FAQ

What format does it use for emoji and characters above U+FFFF?
Characters with code points above 0xFFFF are encoded as UTF-16 surrogate pairs using two \uXXXX sequences, e.g. 🌍 becomes \uD83C\uDF0D. This format is compatible with JSON, JavaScript, Java, and most other languages.
Why are ASCII characters not escaped?
ASCII characters (letters, digits, common symbols) are already universally supported and don't need escaping. Keeping them readable makes the output much easier to work with.
What is the difference between \u and \U escape sequences?
\u followed by 4 hex digits represents characters in the Basic Multilingual Plane (U+0000 to U+FFFF). For characters above U+FFFF (such as emoji), some languages use \U with 8 hex digits or surrogate pairs (two \u sequences).

Related Articles

Related Tools