Unicode Escape Converter
Convert between text and Unicode escape sequences (\uXXXX) in real time.
Format and usage
This tool uses the \uXXXX format (4 hex digits: 0-9, A-F). In Escape mode, each character is converted to \uXXXX; in Unescape mode, \uXXXX is converted back to the original character. The "Insert \u" button appears only in Unescape mode and inserts \u at the cursor. Maximum input length is 10,000 characters.
How to use
About this tool
Converts between text and Unicode escape sequences (\uXXXX) in real time. Supports the format used in JavaScript and JSON. All processing is done in the browser.
How to use
Choose Escape or Unescape, then type or paste text or \uXXXX sequences. The result updates immediately and can be copied. In Unescape mode, use "Insert \u" to insert \u at the cursor.
Options
Direction: Switch between Escape (text→\uXXXX) and Unescape (\uXXXX→text). Format: only \u followed by 4 hex digits (0-9, A-F). Maximum input: 10,000 characters.
Use cases
• Inspecting and converting escaped strings in JavaScript/JSON • Decoding \uXXXX in logs and error messages • Exchanging multilingual text in escape form • Preparing Unicode for regex or code
Code Examples
1// Escape (manual)
2"Hello".split('').map(c => '\\u' + c.charCodeAt(0).toString(16).padStart(4,'0')).join('');
3
4// Unescape
5JSON.parse("\u0048\u0065\u006c\u006c\u006f"); // "Hello"1# Unescape
2"\\u0048\\u0065\\u006c\\u006c\\u006f".encode().decode("unicode_escape") # "Hello"1json_decode('"\u0048\u0065\u006c\u006c\u006f"'); // "Hello"How it works
Escape: Each character's Unicode code point is converted to 4‑digit hex \uXXXX. Characters outside the BMP (e.g. emoji) are output as surrogate pairs \uXXXX\uYYYY. Unescape: \uXXXX is matched by regex and restored with String.fromCharCode. Invalid sequences show an error.
Privacy and data
Conversion is done in the browser; input and results are never sent to a server.
