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/ Your data stays in your browser.
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?
- Paste the text to escape.
- Choose the format: \uXXXX, \u{X}, U+XXXX, HTML hex or decimal, or CSS.
- 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:
Café ☕ 😀 世界
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.
Related tools
Unicode Unescape Converter
Paste text full of \u00e9, U+1F600 or ☺ and read the real characters.
Encoding & Decoding
HTML Entities Encoder
Escape markup characters, or turn every non-ASCII character into an entity such as é or é.
Encoding & Decoding
Unicode Character Inspector
Paste text or an emoji and see exactly which code points, bytes and scripts it is made of.
Encoding & Decoding
Text to Decimal Converter
Get the Unicode number of every character: "é" is 233, "世" is 19990 and 😀 is 128512.
Encoding & Decoding
JSON Escape
Turn any text, even a whole JSON document, into a safe string you can embed inside another JSON value.
JSON & Data
URL Encoder
Make any text safe for a URL: spaces, accents, ampersands and emoji become %XX sequences.
Encoding & Decoding
Text to Hex Converter
See the exact bytes behind any text, from a quick "Hello" to emoji, formatted the way your code or debugger expects.
Encoding & Decoding
Code Point Finder (Unicode Lookup)
Type code points in any common notation, or a range, and see the characters with their decimal, hex, UTF-8, UTF-16 and HTML entity forms.
Encoding & Decoding