Unicode Encode
Convert text to Unicode escape sequences (\uXXXX format).
$text
0 chars1 lines
$unicode escapes[READY]
0 chars1 lines
Related Tools
FAQ
- What is a Unicode escape sequence?
- A Unicode escape sequence represents a character as \uXXXX where XXXX is the four-digit hexadecimal code point (U+0000 to U+FFFF). For example, the letter A is \u0041, the copyright symbol is \u00A9, and the Greek letter alpha is \u03B1.
- How are characters outside the Basic Multilingual Plane handled?
- Characters with code points above U+FFFF (such as emoji) require two surrogate pairs in JavaScript's UTF-16 encoding. For example, 😀 (U+1F600) encodes as \uD83D\uDE00. This tool outputs the surrogate pair representation compatible with JavaScript strings.
- Where would I use Unicode escape sequences?
- Unicode escapes are useful in JavaScript and Java source files when you need to embed non-ASCII characters but want the source file to remain ASCII-only. They are also used in JSON strings, configuration files, and any context where non-ASCII characters might cause encoding issues.
Unicode encoding converts each character in your text to its corresponding Unicode escape sequence in the format \uXXXX, where XXXX is the four-digit hexadecimal code point. This representation is widely used in JavaScript string literals, JSON, Java source code, and other programming contexts where non-ASCII characters need to be safely embedded as ASCII-only escape sequences.