Unicode Escape Converter
Convert text to Unicode escape sequences (\uXXXX) or decode Unicode escapes back to readable characters. Supports JavaScript \uXXXX, extended \UXXXXXXXX, and U+XXXX notation formats. All processing happens locally in your browser.
Text to Unicode Escapes
Convert any text into \uXXXX Unicode escape sequences (JavaScript style).
Unicode Escapes to Text
Decode \uXXXX, \UXXXXXXXX, or U+XXXX escape sequences back to readable characters.
How It Works
Unicode escape sequences represent characters by their numeric code point in hexadecimal. In JavaScript, the \uXXXX format uses four hex digits to encode characters in the Basic Multilingual Plane (U+0000 to U+FFFF). For example, \u0041 represents the letter "A" and \u00E9 represents "e" with an acute accent.
Characters outside the BMP (such as emoji) require surrogate pairs -- two \uXXXX sequences that together identify a single character. The \UXXXXXXXX format uses eight hex digits and can represent any Unicode code point directly. The U+XXXX notation is the standard way to refer to code points in Unicode documentation.
This tool handles all three formats automatically, converting between human-readable text and their escape sequence representations entirely in your browser with no data sent to any server.
Common Use Cases
- JavaScript source code: Embed non-ASCII characters in JS files that must remain ASCII-safe.
- JSON strings: Escape special characters in JSON payloads for cross-platform compatibility.
- Debugging encoding issues: Inspect the exact code points of characters to diagnose garbled text or mojibake.
- Internationalization (i18n): Work with multilingual strings and verify correct character representation.
- Documentation: Reference specific Unicode code points using the standard U+XXXX notation.
Frequently Asked Questions
What are Unicode escape sequences?
Unicode escape sequences are a way to represent Unicode characters using ASCII text. In JavaScript, the format \uXXXX uses four hexadecimal digits to represent a character's code point. For example, \u0041 represents the letter "A" and \u00E9 represents "e" with an acute accent.
What Unicode escape formats are supported?
This tool supports three common formats: \uXXXX (JavaScript-style with 4 hex digits), \UXXXXXXXX (extended format with 8 hex digits for supplementary characters), and U+XXXX (Unicode notation used in documentation and specifications).
Why would I need to convert text to Unicode escapes?
Unicode escapes are useful when you need to include special characters in source code that only supports ASCII, when debugging encoding issues, when working with internationalized strings in JavaScript or JSON, or when documenting specific Unicode code points.
How are characters outside the Basic Multilingual Plane handled?
Characters outside the BMP (code points above U+FFFF), such as emoji, are encoded as surrogate pairs using two \uXXXX sequences in JavaScript format. The tool automatically handles this conversion in both directions.