Encode & Decode Unicode Escape Sequences ✨
Instantly 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. - Privacy First: All processing happens locally in your browser. Your data never touches a server.
🧐 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.
Is my data safe? Absolutely. The tool runs entirely on the client side; no data is transmitted or stored.
📚 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.