What is a Unicode escape?
A Unicode escape is a way to write a character using only plain ASCII, by giving its number in a format a language understands. Developers use escapes to put non-English text in source code and config files, to make JSON safe for old systems, and to spot hidden characters.
Paste text and choose JavaScript or JSON (\uXXXX), ES6 (\u{…}), Python, HTML hex or decimal entities, CSS escapes, U+ code points or UTF-8 bytes in hex. Keep plain ASCII unchanged if you like. Switch to unescape to turn any of these formats back into readable text.
How to use the Unicode escape converter
1.Paste text
Or escaped text to decode.
2.Pick a format
JavaScript, Python, HTML, CSS, U+ or UTF-8 bytes.
3.Copy
Plain ASCII can be left as it is.
Example: text with accents and emoji
"Café ✓ 日本 🚀" in three formats:
- JavaScript
- Caf\u00E9 \u2713 \u65E5\u672C \uD83D\uDE80
- HTML
- Café ✓ 日本 🚀
- UTF-8 of 🚀
- F0 9F 9A 80
The same five special characters, written safely for each destination.
Emoji and surrogate pairs
Characters beyond the first 65,536, which includes most emoji, don't fit in one \uXXXX escape. JavaScript and JSON write them as a surrogate pair, so 🚀 becomes \uD83D\uDE80, while ES6 \u{1F680}, Python \U0001f680, HTML 🚀 and CSS \1F680 use the code point directly.
Unescaping understands every one of those forms, even mixed in the same text, and joins surrogate pairs back into a single character. The UTF-8 option shows the actual bytes stored on disk or sent over the network.
Frequently asked questions
When do I need escapes?
When a file or system only accepts ASCII, or to make invisible and look-alike characters obvious in code.
Why does CSS add a space after the escape?
It ends the escape, so the next letter isn't read as part of the hex number.
What's the difference between a code point and UTF-8?
The code point is the character's number; UTF-8 is how it's stored, in 1 to 4 bytes.
Is my text uploaded?
No. It stays on this page.
Related tools
Unicode Character Inspector
See the code points, bytes and hidden characters in any text.
HTML Entity Encoder & Decoder
Escape text to HTML entities, or decode entities back to text.
JSON Escape & Unescape
Escape text for a JSON string, or unescape \n, \" and \u codes.
Base64 Encoder & Decoder
Base64 and Base64url for text (UTF-8) and files.
URL Encoder & Decoder
Percent-encode or decode URLs and query values, and see a URL's parts.
JWT Decoder
Decode a JSON Web Token's header and payload and check its expiry.
More Developer tools
JSON & data
CSV tools
Network & system
Web & API
Git & releases
Encoding & security
Text & code
- Regex tester
- Text diff checker
- Cron expression explainer
- Lorem ipsum generator
- Markdown previewer
- Slug generator
- Strip HTML tags
- URL parser
- Markdown TOC generator
- cURL converter
- Whitespace visualizer
- Markdown link extractor
- Regex escape
- Regex match extractor
- Split text by regex
- HTML, CSS and JS playground
- Mock data generator
- Keyboard event tester
- ASCII table