Convert Text to Unicode Escapes Online
Converting text to Unicode escape sequences produces an ASCII-safe representation of any Unicode text, including characters from any language, emoji, and symbols. Unicode escapes (\uXXXX format) are used in JavaScript string literals, JSON, Java source code, and many other contexts to include non-ASCII characters without relying on file encoding settings. This tool encodes your text to Unicode escapes, converting each non-ASCII character (and optionally all characters) to its \uXXXX hexadecimal code point form. This is useful for hardcoding international strings in source code, debugging character encoding issues, or creating ASCII-safe representations of text for storage in legacy systems that do not support full Unicode.
text
0 chars1 lines
unicode escapesREADY
0 chars1 lines
FAQ
- Which characters get converted to Unicode escapes?
- By default, only non-ASCII characters (code point > 127) are escaped, leaving ASCII letters, digits, and common punctuation as-is. Some modes escape all characters including ASCII.
- Is the output valid in JavaScript strings?
- Yes. The \uXXXX format is valid in JavaScript string literals, JSON values, Java strings, and many other programming language string syntaxes.
- How are supplementary characters (emoji) handled?
- Characters above U+FFFF are represented as two UTF-16 surrogate pairs in \uXXXX form, or as \u{XXXXXX} if the extended format is used.