What is Unicode escaping?
Unicode escaping is the process of representing non-ASCII characters using escape sequences in the form \uXXXX, where XXXX is the hexadecimal code point of the character. This makes it possible to include any Unicode character in contexts that only support ASCII, such as certain programming languages, data formats, or legacy systems.
Examples of Unicode escaping
Original text with non-ASCII characters
Café au lait - French coffee with milk
Résumé - Summary of qualifications
こんにちは - Hello in Japanese
你好 - Hello in Chinese
Привет - Hello in Russian
안녕하세요 - Hello in Korean
Γειά σου - Hello in Greek
مرحبا - Hello in Arabic
שלום - Hello in Hebrew
Olá - Hello in PortugueseConverted to escaped Unicode
Caf\u00e9 au lait - French coffee with milk
R\u00e9sum\u00e9 - Summary of qualifications
\u3053\u3093\u306b\u3061\u306f - Hello in Japanese
\u4f60\u597d - Hello in Chinese
\u041f\u0440\u0438\u0432\u0435\u0442 - Hello in Russian
\uc548\ub155\ud558\uc138\uc694 - Hello in Korean
\u0393\u03b5\u03b9\u03ac \u03c3\u03bf\u03c5 - Hello in Greek
\u0645\u0631\u062d\u0628\u0627 - Hello in Arabic
\u05e9\u05dc\u05d5\u05dd - Hello in Hebrew
Ol\u00e1 - Hello in PortugueseCommon Unicode escape sequences
| Character | Unicode escape | Description |
|---|---|---|
| é | \u00e9 | Latin small letter e with acute |
| ñ | \u00f1 | Latin small letter n with tilde |
| ö | \u00f6 | Latin small letter o with diaeresis |
| € | \u20ac | Euro sign |
| あ | \u3042 | Hiragana letter a |
| 中 | \u4e2d | CJK unified ideograph (middle) |
| Б | \u0411 | Cyrillic capital letter be |
| α | \u03b1 | Greek small letter alpha |
When to use Unicode escaping
- When working with programming languages or environments that require ASCII-only source code
- When creating JSON or other data formats that need to be portable across different systems
- When storing text in databases or files that don't fully support Unicode
- When debugging issues related to character encoding
- When creating configuration files that need to be edited in environments with limited Unicode support
Unicode escaping in different programming languages
| Language | Unicode escape format | Example |
|---|---|---|
| JavaScript | \uXXXX | var text = "Caf\u00e9"; |
| Java | \uXXXX | String text = "Caf\u00e9"; |
| C# | \uXXXX | string text = "Caf\u00e9"; |
| Python | \uXXXX or \UXXXXXXXX | text = "Caf\u00e9" |
| Ruby | \uXXXX | text = "Caf\u00e9" |
Note:
While Unicode escaping makes text compatible with ASCII-only environments, it makes the text less readable for humans. Use it when technical compatibility is required, but prefer direct Unicode when possible in modern systems that fully support it.
Related Tools
- Convert from Unicode - Convert Unicode escape sequences back to characters
- Convert Characters to Integer Values - Convert text to ASCII/Unicode values
- Convert Diacritics to ASCII - Remove accents and other diacritical marks
- Escape JavaScript - Escape special characters in JavaScript strings
- Escape JSON - Escape special characters in JSON strings
All Tools
See all available tools