Skip to main content

Unicode Escape & Unescape

Convert characters into JavaScript-style \uXXXX Unicode escapes, or decode escapes back into characters. Useful for internationalization and debugging.

Reviewed for accuracy by the Math Ora X team Last updated

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

  1. Paste the text or escape sequence you want to convert into the input box.
  2. Choose whether you want to encode characters into \u escapes or decode \u escapes back into text.
  3. Run the conversion and review the result in the output area.
  4. Copy the result into your code, test data, or debugging notes.

Step by step, what happens

  1. The tool reads your input as plain text or as JavaScript-style Unicode escape sequences, depending on the mode you choose.
  2. In escape mode, it converts each character into a \uXXXX sequence when that character fits a four-digit Unicode escape.
  3. In unescape mode, it scans for \u escapes and replaces them with the matching Unicode characters.
  4. 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é

  1. You paste Cafe with an accented e into the tool and choose Unicode escape mode.
  2. The tool converts the accented character into its JavaScript-style Unicode escape sequence.
  3. 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

You Might Also Like

Popular tools from other categories

Can't Find the Right Calculator?

Try our AI Math Solver, type any problem in plain English and get instant step-by-step solutions.

Try AI Solver

Browse All Categories

Home Developer Tools Current Tool
Facebook Twitter WhatsApp