JSON Escape and Unescape
Escape and unescape JSON string content safely.
Convert Unicode text into JavaScript, JSON, Python, Java, HTML, CSS, or U+ notation, or decode supported escape syntax back to characters.
Choose the syntax family explicitly because JavaScript, JSON, Python, Java, HTML, CSS, and Unicode notation use different rules.
Your text is processed in this browser and is not submitted to UnicodeNow.
Convert Unicode text to escape syntax, code-point notation, or HTML numeric character references, and decode supported representations back to text.
Operation
Each syntax is generated according to its own parser family, not as a generic entity format.
Auto-detect reports ambiguity instead of pretending that shared syntax belongs to one language.
Paste literal text or selected escape syntax. Input remains local to this browser.
Decoded output is plain text. It is not executable code and is not automatically safe for HTML, JavaScript, SQL, shell commands, or other contexts.
This converter turns Unicode text into language and format-specific escape syntax, then decodes supported escape representations back to characters. It covers JavaScript \uXXXX, JavaScript \u{...}, strict JSON escapes, Python \u and \U forms, Java UTF-16 escapes, HTML numeric character references, CSS escapes and human-readable U+ notation. The page processes text locally in your browser and does not execute decoded content.
The important rule is that escape syntax belongs to a parser. A sequence valid in JavaScript may be invalid in JSON, and an HTML numeric reference is not JavaScript syntax. Use the syntax selector before decoding so malformed input is reported instead of quietly interpreted by the wrong rules.
| Character | Code point | JavaScript | JSON | Python | HTML hex |
|---|---|---|---|---|---|
A | U+0041 | \u0041 | \u0041 | \u0041 | A |
é | U+00E9 | \u00E9 | \u00E9 | \u00E9 | é |
😀 | U+1F600 | \u{1F600} | \uD83D\uDE00 | \U0001F600 | 😀 |
The four-digit \uXXXX form stores hexadecimal digits in source text. In JavaScript, JSON and Java contexts it represents a UTF-16 code unit, not always a full Unicode scalar value. Basic Multilingual Plane characters such as é fit in one escape: \u00E9. Values above U+FFFF need a syntax that supports full code points or a valid surrogate pair.
The emoji 😀 is code point U+1F600. JSON and Java-style UTF-16 escape syntax writes it as \uD83D\uDE00: a high surrogate followed by a low surrogate. The two escapes together decode to one code point. \uD83D by itself, \uDE00 by itself, and reversed order are malformed and should be rejected.
Modern JavaScript accepts code-point escapes such as \u{1F600}. Strict JSON does not; JSON uses \uXXXX and surrogate pairs for supplementary characters. Python uses \uXXXX for BMP values and \UXXXXXXXX for long escapes. Java strings use UTF-16 escapes. HTML uses numeric character references such as é and é. CSS uses a backslash followed by one to six hexadecimal digits and may need a terminating space.
Auto-detect is useful for obvious markers, but it is deliberately conservative. The input \u00E9 is shared by JavaScript, JSON, Python and Java, so the converter reports it as ambiguous. By contrast, \u{1F600} is JavaScript code-point syntax, \U0001F600 is Python-style syntax, and 😀 is an HTML hexadecimal reference. When correctness matters, choose the exact input syntax instead of relying on guessing.
é
Code point: U+00E9
Escape: \u00E9
UTF-8 bytes: C3 A9
Escapes are text notation. UTF-8 bytes are an encoded storage or transport representation. Do not turn the UTF-8 bytes C3 A9 into \uC3A9 or HTML references é when you mean é.
The text \u00E9 can be an escape sequence for é, or it can be six literal characters: backslash, u, zero, zero, E, nine. The text \\u00E9 usually decodes one layer to the literal string \u00E9. This tool reports a remaining-layer notice instead of automatically decoding repeatedly.
Separators are also syntax-sensitive. Continuous source-code strings normally use no separator, while Unicode notation is often easier to read with spaces or new lines. The All representations option produces one structured row per code point so you can compare JavaScript, JSON, Python, Java, HTML, CSS, UTF-8 bytes and UTF-16 code units without mixing those formats into one ambiguous output string.
Double escaping happens when already escaped text is escaped again, such as \u00E9 becoming \\u00E9. That may be correct when a string is nested inside another string, but it is often a pipeline bug. Decode one layer at a time and stop when the application contract says the value is ordinary text.
Use Escape non-ASCII characters when you want readable ASCII text with non-ASCII characters represented numerically. Use Escape all characters when every code point must be visible as notation. Preserve printable ASCII keeps ordinary ASCII letters and punctuation readable while still escaping controls and non-ASCII characters.
This tool runs in your browser. Your input is not submitted to UnicodeNow. Output is written as textarea text, not inserted as executable markup or code.
A source or data notation representing a Unicode value with numeric syntax.
It commonly represents U+0041, LATIN CAPITAL LETTER A.
U+0041 is Unicode notation; \u0041 is parser syntax used by several languages and formats.
Because UTF-16 represents supplementary code points with surrogate pairs.
No. It is JavaScript syntax, not strict JSON.
Python-style notation for U+1F600.
They serve a similar purpose but are HTML character-reference syntax.
No. Escapes are text syntax; UTF-8 is an encoded byte sequence.
Yes, when the input syntax is selected or reliably detected.
An additional escaping layer has been added to already escaped text.
No, unless normalization is explicitly enabled.
No. This tool runs in your browser and does not submit input to UnicodeNow.
Escape and unescape JSON string content safely.
Escape JavaScript string literals and decode JS escape notation without eval.
Encode and decode HTML named, decimal and hexadecimal entities.
Convert Python string escapes without executing Python code.
Escape and unescape PHP-style single and double quoted strings.
Escape and decode XML entities and numeric character references.
Convert text to UTF-8 bytes and validate byte sequences.
Inspect each Unicode character, encoding, category, script and normalization form.
Convert text into U+XXXX Unicode code point notation.
Convert U+XXXX, 0x, and escape-style code points back to text.
Count UTF-8 bytes, code points, grapheme clusters and UTF-16 code units for text.
Analyze code points, grapheme clusters, bytes, scripts and directionality.
Unicode defines characters and code points. UTF-8 encodes those code points as bytes for files, databases, web pages, APIs and network messages.
Learn what Unicode code points are, how U+ notation works, and how code points differ from glyphs, bytes, code units and visible characters.
Learn NFC, NFD, NFKC and NFKD, canonical and compatibility equivalence, and safe normalization for comparison, search and identifiers.
Learn how Unicode escape syntax works across JavaScript, JSON, Python, PHP, Java, HTML, CSS and URLs.
Compare literal Unicode characters, named HTML entities, numeric character references, code points and UTF-8 bytes.
Choose the right Unicode length unit for UI limits, storage limits, APIs, JavaScript, Python and PHP.