Skip to content

Unicode Escape Converter

Turn é, ☕ and 😀 into \u00E9, \u2615 and \uD83D\uDE00 (or another escape style) for source code, JSON or CSS.

Processed locally in your browser

Options
0 chars · 0 lines
The result will appear here.

What is Unicode Escape Converter?

Unicode escapes describe characters by their code point instead of typing them directly. They keep source files pure ASCII, survive tools with poor encoding support and make invisible or look-alike characters visible. Each language has its own style: \uXXXX in JavaScript, JSON and Java, \u{1F600} in ES6, U+1F600 in documentation, 😀 in HTML and \1F600 in CSS.

This converter offers all of them. Characters above U+FFFF are written as a UTF-16 surrogate pair in the \uXXXX style (\uD83D\uDE00), as one code point in the other styles. By default only non-ASCII characters are escaped; tick "Escape every character" to also escape letters and digits. U+ and CSS output is padded when a hex digit follows, so it can be read back without ambiguity.

How does it work?

  1. Paste the text to escape.
  2. Choose the format: \uXXXX, \u{X}, U+XXXX, HTML hex or decimal, or CSS.
  3. Decide whether to escape every character and whether hex digits should be uppercase, then copy the result or press Swap to unescape.

Common use cases

  • Writing non-ASCII text into a JSON file, Java properties file or JavaScript string safely.
  • Adding a symbol to CSS with content: "\2615".
  • Documenting characters as U+XXXX in a specification or bug report.
  • Making zero-width or look-alike characters in a string visible and diffable.

Examples

Try this input in the tool above:

Input
Café ☕ 😀 世界
Output
Caf\u00E9 \u2615 \uD83D\uDE00 \u4E16\u754C

Privacy

Unicode Escape Converter runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.

Limitations

Escapes describe code points, not glyphs: a flag or family emoji is several code points and produces several escapes. The receiving language must support the chosen syntax (for example \u{…} needs ES6).

Frequently asked questions

Why does 😀 become two \u sequences?

JSON, Java and classic JavaScript escapes hold 16 bits, so characters above U+FFFF are written as a surrogate pair: \uD83D\uDE00. The \u{1F600} style avoids that.

What is the difference from URL encoding?

Unicode escapes name code points for source code and markup. URL encoding writes UTF-8 bytes as %XX for use inside links. Use the URL Encoder for addresses.

Should I escape ASCII letters too?

Rarely. The option exists for obfuscation, tests or to see every code point. Normally leave it off so only non-ASCII characters change.

More tools in Encoding & Decoding →