Unicode Escape & Unescape
Convert characters into JavaScript-style \uXXXX Unicode escapes, or decode escapes back into characters. Useful for internationalization and debugging.
About this tool
Convert characters into JavaScript-style \uXXXX Unicode escapes, or decode escapes back into characters. Useful for internationalization and debugging.
Example
Input: A♥
Output: \u0041\u2665
Privacy
This tool runs entirely in your browser. Your data is processed locally and never uploaded to a server.
How to use this tool
- Paste the text or escape sequence you want to convert into the input box.
- Choose whether you want to encode characters into \u escapes or decode \u escapes back into text.
- Run the conversion and review the result in the output area.
- Copy the result into your code, test data, or debugging notes.
Step by step, what happens
- The tool reads your input as plain text or as JavaScript-style Unicode escape sequences, depending on the mode you choose.
- In escape mode, it converts each character into a \uXXXX sequence when that character fits a four-digit Unicode escape.
- In unescape mode, it scans for \u escapes and replaces them with the matching Unicode characters.
- It leaves ordinary text alone when there is nothing to convert, which makes it useful for checking mixed strings during debugging.
Worked example
Suppose you want to encode a short greeting with a non-ASCII character for a JavaScript string.
Input: Café
- You paste Cafe with an accented e into the tool and choose Unicode escape mode.
- The tool converts the accented character into its JavaScript-style Unicode escape sequence.
- You copy the escaped result into your code or config file.
Output: Caf\u00e9
Tips and common mistakes
- Use escape mode when you need a safe text form for logs, source code, or config files.
- Use unescape mode when you see \u sequences in a string and want to read the original text.
- Remember that this tool uses JavaScript-style escapes, so plain backslashes in your input can affect how the text is interpreted.
- If a character is outside the basic four-digit \uXXXX range, check whether your code needs a different Unicode handling approach.
Frequently asked questions
What is a \u escape?
It is a way to write a Unicode character by its code point, e.g. \u0041 for the letter A.
Does it support emoji?
Yes, code points above U+FFFF use the \u{...} form.
Where is this used?
In JavaScript, JSON, and many programming languages to represent characters portably.
More Developer Tools Tools
Explore related calculators in this category
String Escape / Unescape
Escape or unescape strings for JSON, JavaScript and code, handle quotes, backslashes, newlines and tabs.
.htaccess Generator
Generate common .htaccess rules, force HTTPS, www redirect, and caching, with checkboxes.
API Key Generator
Generate random, secure API keys and tokens with an optional prefix. Cryptographically secure.
Apache Log Parser, Free Online Developer Tool
Parse Apache/NGINX combined access log lines into IP, time, request, status and size fields. Get instant results, the formula, and a clear example.
You Might Also Like
Popular tools from other categories
Escape Velocity Calculator
Calculate the escape velocity from a celestial body.
JSON Escape
Escape text for safe use inside a JSON string, handles quotes, backslashes and newlines.
Text to Unicode
Convert text to Unicode escape sequences (U+ notation and \u escapes) instantly.
1031 Exchange Calculator - Free Online
Free Calculate tax deferral in a 1031 exchange. Step-by-step solutions and formulas included. Fast, accurate, and free, with formula and example.
Can't Find the Right Calculator?
Try our AI Math Solver, type any problem in plain English and get instant step-by-step solutions.