search

Found

info Overview

Encode text to JavaScript \uXXXX, CSS \XXXX or HTML &#xXXXX; escapes and decode them back, with \u{...} for emoji and a multi-byte-only option.

📘 How to Use

  1. Choose Encode or Decode, then type into "Input text or code".
  2. Pick a Format (JavaScript, CSS or HTML Entity) and, if needed, switch "Escape multi-byte characters only".
  3. Press Copy to copy the Result.

Unicode Escape Converter

Copied!
Article

Encode & Decode Unicode Escape Sequences ✨

Convert text to Unicode escape sequences (\uXXXX) and back. Prevent encoding bugs and ensure character safety across JavaScript, CSS, and HTML files.

💡 Why use this?

Represent non-ASCII characters safely in your source code. Whether you are defining icons in CSS content properties or sanitizing strings for legacy environments, this tool automates the tedious hex-coding process.

Paste your text, pick your format, and copy your code.

📘 Features

  • Multi-Format Support: Switch between JavaScript (\uXXXX), CSS (\XXXX), and HTML Entities (&#xXXXX;) with one click.
  • Selective Encoding: Use the "Escape multi-byte characters only" toggle to keep standard Latin text readable while encoding only symbols or foreign scripts.
  • Emoji & ES6 Ready: Fully supports surrogate pairs and the modern \u{XXXXXX} syntax for high-plane characters like emojis.

🧐 FAQ

When should I use this? Use it whenever you need to ensure text remains intact across different environments—like embedding strings in scripts, defining characters in CSS, or preventing encoding corruption in legacy systems.

Does it support decoding? Yes. Switch to "Decode" mode to transform escape sequences back into human-readable text.

📚 Technical Note

The standard \uXXXX format uses a 16-bit hex code, capping it at 65,536 characters. As the emoji library expanded, the industry moved to "Surrogate Pairs" and the newer ES6 bracketed syntax—like \u{1F600}. This tool automatically detects and applies the correct syntax for your target environment.