Unicode Escape Sequence Generator
Convert characters into \uXXXX or code-point escape sequences for JavaScript, JSON, and APIs.
- Aucune limite de longueur
- Sans inscription
- Gratuit pour toujours
- Votre texte ne quitte jamais votre navigateur
How the \uXXXX Syntax Works
The \uXXXX form writes one character as backslash-u plus four hexadecimal digits, and those four digits represent exactly one UTF-16 code unit. For the characters that fit in the Basic Multilingual Plane — the vast majority of everyday letters — one escape is one character, so é becomes \u00E9.
Characters beyond that plane, which includes most emoji, do not fit in four digits: they occupy two UTF-16 code units and therefore require a surrogate pair, two \uXXXX escapes that represent one character. Modern JavaScript also accepts the brace form — \u{1F600} — which names a full code point directly and avoids the pair entirely.
Reading the syntax correctly is half the battle: \u00E9 is a parsed escape that becomes é, while a string containing the literal characters backslash-u-0-0-E-9 is just text. The difference is exactly where the confusing bugs live.
JSON and Unicode
JSON permits literal Unicode characters and escaped sequences alike, and both parse to the same string. Escaping matters when the surrounding conditions are not friendly to raw characters: source files that must stay ASCII, build pipelines with legacy tooling, or strings that will be embedded inside other formats where a literal quote or control character would break the parse.
Escaping also earns its keep as an inspection tool. A string full of invisible or zero-width characters becomes legible in escaped form, which is why developers escape text when debugging why two supposedly identical strings refuse to match.
For JSON specifically, the rules are simple: quote characters and control characters must be escaped to keep the document valid, and everything else can stay literal unless your toolchain says otherwise. The generator produces escapes that satisfy both the letter of the spec and the reality of ASCII-only pipelines.
Questions fréquentes
Why does escaped text show up as literal \\uXXXX in the browser?
The browser received an ordinary string containing the literal characters backslash, u, and four hex digits — it was never parsed as an escape. That happens when the text went through a layer that treats backslashes as data (a second encoding pass, a template that double-escapes, or a language that does not interpret the sequence). The fix is to parse the escape once at the right layer: let the language or JSON parser decode it into the actual character before the browser ever sees it. A quick diagnostic is to view the page source: if the \uXXXX appears in the served HTML, the escaping happened too early or too late in the pipeline, and the parse must move to the layer that produces the final string.
Votre texte ne quitte jamais votre navigateur
Chaque outil fonctionne localement sur votre appareil. Rien de ce que vous collez n’est envoyé, stocké ou suivi.