Unicode Escape & Unescape
Convert text to and from \uXXXX escape sequences and HTML entities.
Converted live as you type. Nothing leaves your browser.
Direction
Format
By default only non-ASCII and control characters are escaped. Turn on to escape every character.
How to escape and unescape Unicode text
Choose a direction
Pick Escape to turn characters into sequences, or Unescape to decode sequences back into readable text.
Paste your input
Enter text like café ☕ or escapes like caf\u00E9. The output converts live on every keystroke.
Pick an escape format
In Escape mode, choose between \uXXXX, \u{XXXX}, decimal entities like é, and hex entities like é. An extra toggle escapes every character instead of only non-ASCII ones.
Copy the result
Click Copy to clipboard to take the converted string into your editor or template.
Why use this tool
Four output formats
Escape to classic JavaScript \uXXXX units, ES6 \u{XXXX} code points, decimal HTML entities, or hexadecimal HTML entities, switching between them with one click.
Unescape needs no configuration
Decoding recognises \u{...}, \uXXXX, \xXX, decimal and hex numeric entities, and named entities such as & in a single pass, so mixed input just works.
Surrogate pairs handled correctly
In \uXXXX format, characters beyond U+FFFF are emitted as their two UTF-16 code units, exactly as a JavaScript string literal requires.
Readable output by default
Plain ASCII passes through untouched unless you enable Escape all characters, so escaped strings stay diffable and reviewable.
Safe HTML output
The characters &, <, >, ", and ' are always converted in the HTML entity modes, so the result can be dropped into markup without breaking it.
Local and free
Conversion happens in the page with nothing sent to a server, and there is no account or usage limit.
About this tool
This converter moves text between readable characters and escape sequences in both directions. Escape mode rewrites any non-ASCII or control character as a JavaScript \uXXXX escape, an ES6 \u{XXXX} code point escape, or a decimal or hexadecimal HTML entity, with an option to escape every character instead. Unescape mode detects all of those formats plus \xXX escapes and named HTML entities, turns them back into text, and leaves anything unrecognised alone.
Escapes come up whenever text passes through a channel that cannot be trusted with raw Unicode: string literals in source files kept ASCII-only, JSON fixtures, properties files, email templates, and HTML attributes. In the other direction, log files and API responses often arrive full of \u00e9 noise, and pasting them here shows what the software was actually saying.
The conversion is pure client-side JavaScript, so tokens and user data inside the strings never leave your machine. This tool answers how to write a character; when the question is what a character is, its code point, bytes, and name, that is the Unicode inspector's job. For binary-safe transport encodings see Base64, and for query strings use the URL encoder.
Frequently asked questions
- What does this tool do?
- It converts text into escape sequences and back. In Escape mode it turns characters into JavaScript \uXXXX or \u{XXXX} escapes, or HTML numeric entities like é and é. In Unescape mode it decodes those sequences, plus \xXX escapes and named HTML entities such as & and ©, back into readable text.
- What is the difference between \uXXXX and \u{XXXX}?
- \uXXXX is the classic JavaScript escape that works on UTF-16 code units, so characters outside the Basic Multilingual Plane (like many emoji) are written as a surrogate pair of two \uXXXX escapes. \u{XXXX} is the ES6 code-point escape that represents the whole character with a single value.
- Which characters get escaped?
- By default only non-ASCII characters (above U+007E) and control characters are escaped, so normal English letters stay readable. Turn on "Escape all characters" to escape every character. In HTML modes the special characters &, <, >, ", and ' are always escaped for safety.
- Is unescape automatic?
- Yes. In Unescape mode the tool detects and decodes \u{...}, \uXXXX, \xXX, decimal and hexadecimal HTML entities, and named HTML entities automatically, with no format to pick. Anything it does not recognize is left unchanged so nothing is lost.
- Is my text uploaded anywhere?
- No. Everything runs entirely in your browser using JavaScript. Your text is processed on your device and never sent to a server, stored, or logged.
Related tools
Base64 Encode & Decode
Encode text, files, and images to Base64, decode it back, and get a ready-to-use data URI.
URL Encode & Decode
Percent-encode text for URLs and decode it back, both directions.
Arrow Symbols
Browse and copy arrow symbols in every direction and style, then build a string of them.
Bold Text Generator
Turn plain text into bold, bold italic, and bold serif Unicode styles you can copy.
Bubble Text Generator
Turn plain text into circled bubble letters, outline and filled, ready to copy.
Currency Symbols
Browse and copy world currency symbols by name, from dollar and euro to rupee and won.