Unicode Converter

Our online Unicode converter transforms text into Unicode escape sequences, hex codes and code point notations, or unescapes code points back to readable characters. Convert strings to JavaScript and Java escapes, ES6 braces, Python escapes or standard U+hex formatting.

Updated

Direction

Understanding Unicode escape formats across languages

Modern software development spans multiple programming languages, database engines and network protocols, each using distinct conventions for representing non-ASCII characters in source code. When source files cannot safely contain literal UTF-8 characters due to file encoding limitations or linter rules, developers rely on escape sequences. A dedicated Unicode converter bridges these format differences by translating human-readable text into exact technical escape notations.

Common escape notations include:

  • JavaScript and Java (\uXXXX): The classic 4-hex-digit escape format representing characters in the Basic Multilingual Plane (U+0000 to U+FFFF). For example, a star symbol ★ converts to a 4-digit escape.
  • ECMAScript 6 (\u{X…XXXXXX}): Modern JavaScript syntax that accommodates any code point from U+0 to U+10FFFF between curly braces without needing manual surrogate pair arithmetic.
  • Python and C (\xXX and \UXXXXXXXX): Standard byte and 8-digit hexadecimal notation used in Python, C, and C++ string literals to avoid terminal encoding conflicts.
  • Unicode Code Point (U+XXXX): The canonical notation specified by the Unicode Consortium, standard in technical documentation and character registries.

Astral plane characters and surrogate pairs

Characters with code points higher than U+FFFF—such as emoji, ancient scripts, and mathematical alphanumeric alphabets—reside in supplementary planes known as astral planes. In systems based on 16-bit encoding like UTF-16, Java strings, and JavaScript internal engines, these characters cannot fit into a single 16-bit value and must be encoded as two surrogate code units. When converting emoji or supplementary symbols to legacy formats, this converter computes the high and low surrogate values automatically. To understand how code points map to binary formats, consult our guide to what is Unicode and Unicode in CSS and JavaScript.

Unescaping strings and decoding logs

Developers frequently encounter raw escape sequences in server logs, JSON error dumps, and URL parameters. When debugging an API response containing unreadable strings, switching the tool to Unescape mode decodes all recognized escape sequences back into plain, readable text. The decoder automatically recognizes ES6 braced escapes, standard 4-digit hex, 8-digit Python escapes, URL percentage encodings, and HTML numeric entities simultaneously. You can also inspect specific individual characters with the Unicode character lookup or convert web entities with the HTML entity converter.

Frequently asked questions

What escape formats does the Unicode converter support?

The converter supports standard 4-digit JavaScript/Java escapes (\uXXXX), ES6 variable-length braced escapes (\u{XXXX}), Python/C escapes (\xXX and \UXXXXXXXX), and canonical U+XXXX notation.

How do Unicode escapes work for characters beyond U+FFFF?

Characters beyond U+FFFF require either modern ES6 braced escapes like \u{1F600} or UTF-16 surrogate pairs consisting of two 16-bit code units, both of which are supported.

When should I use Unicode escape sequences instead of raw characters?

Use escapes when source files must remain strictly ASCII-compliant, when working with editors that lack font support for specific symbols, or to prevent corruption across legacy pipelines.

Can this tool decode mixed strings with text and escape codes?

Yes. The unescape mode parses mixed text containing standard words alongside embedded escape codes, converting only the recognized sequences while leaving plain text intact.