Unicode Escape
Escape text into \u code point sequences for source code. Free, and runs entirely in your browser — nothing you enter is uploaded or stored.
About Unicode Converter
This converter moves between readable text and the escape forms used in source code — \uXXXX, \u{XXXXX} and \xXX. Escaping is how you get an emoji or a Cyrillic name safely through a config file, a properties file or a system that only tolerates ASCII.
Which escape syntax to write is a question about where the text is going, not about the text. \uXXXX is what a JavaScript, JSON or Java string literal takes; &#xXXXX; and &#NNNN; are what markup takes. Putting one where the other belongs fails quietly — a é inside a JavaScript string stays six literal characters, and a \u00e9 in HTML stays six literal characters, and neither looks wrong at a glance. All three are shown together for that reason.
The inspect mode is the diagnostic one: it lists every character with its code point, decimal value and UTF-8 bytes, and counts both characters and bytes. That is what identifies the invisible troublemakers — non-breaking spaces, zero-width joiners, smart quotes pasted in from a word processor, or a combining accent that only looks like a single letter.
Where it helps
- Escape, unescape and inspect in one place.
- Writes escapes as JavaScript
\uXXXXor as hexadecimal or decimal character references, and shows all three side by side. - Reads every one of those forms back, so anything escaped here unescapes here.
- Handles astral characters such as emoji as whole code points, not broken surrogate halves.
- Byte counts show what a UTF-8 length limit will actually measure.
- Escaping only non-ASCII keeps the readable parts of your string readable.
Limits
- Inspection reports code points, not grapheme clusters, so a flag emoji or an accented letter built from two code points shows as more than one row.
- It does not normalise text: visually identical strings in NFC and NFD forms remain different here, as they are for a computer.
\xXXescapes only cover the first 256 code points, which is a limit of the notation itself.
Frequently asked questions
Why does one emoji count as two characters somewhere else?
Because that system counts UTF-16 units. Emoji above U+FFFF take two of them. The inspect mode shows the real code point and the UTF-8 byte length.
Why do two strings that look identical fail a comparison?
Inspect both. You will usually find a non-breaking space, a smart quote, or a combining accent instead of a precomposed character.
Which escape form should I use in JavaScript or JSON?
\uXXXX works everywhere. \u{...} is cleaner for astral characters in JavaScript but is not valid JSON.
Does unescaping accept mixed notations?
Yes. \u{1F600}, \u00e9 and \xe9 in the same string are all resolved.
Related tools
- Base64 — Encode or decode UTF-8 text and URL-safe Base64
- HTML Entities — Escape and unescape HTML entities
- Word Counter — Count words, characters, sentences and reading time
- Case Converter — Switch between sentence, camel, snake and other cases
- Base32 — Encode or decode Base32 in the RFC 4648, extended hex and Crockford alphabets
- Base58 — Encode or decode Base58, and verify the Base58Check checksum an address carries
More Encoders & Decoders tools
- Base64 — Encode or decode UTF-8 text and URL-safe Base64
- Base32 — Encode or decode Base32 in the RFC 4648, extended hex and Crockford alphabets
- Base58 — Encode or decode Base58, and verify the Base58Check checksum an address carries
- URL Encoder — Percent-encode components or whole URLs
- HTML Entities — Escape and unescape HTML entities
- JWT — Read, verify and sign JSON Web Tokens
- Punycode — Convert internationalised domain names to and from their ASCII form
- Unicode Converter — Escape, unescape and inspect code points
- Unicode Inspector — Analyse every character: category, script, block and encoding
- Number Base Converter — Binary, octal, decimal and hexadecimal, with the bits explained
- Hex and Text Converter — Text to hexadecimal bytes and back, with a dump
- Gzip Compressor and Decompressor — Compress and expand gzip, zlib and raw deflate