HTML Entity Encoder and Decoder
Encode and decode HTML named, decimal and hexadecimal entities.
Escape plain text for JSON strings or decode strict JSON escape sequences such as \", \\, \n and \uXXXX back to Unicode text.
This tool processes JSON string content. It is not a JSON formatter, validator or object editor.
Your text is processed in this browser and is not submitted to UnicodeNow.
This tool escapes plain text for use inside a JSON string or unescapes strict JSON string escape sequences back to Unicode text. It does not format or edit complete JSON objects and arrays.
Operation
String content has no surrounding quote marks; a complete literal is valid for JSON.parse().
Literal Unicode is valid in JSON encoded as UTF-8. Enable ASCII-only output only when a receiving system requires it.
This tool parses string content or one complete quoted JSON string, not JSON objects or arrays.
Paste plain text or strict JSON string escape content. Input remains local to this browser.
Unescaped output is plain text. It is not automatically safe for HTML, JavaScript, SQL, shell commands or other destination contexts.
This tool escapes plain text so it can be used as JSON string content, or as a complete JSON string literal with surrounding quotation marks. It also unescapes strict JSON string escape sequences back to Unicode text. The tool distinguishes raw string content from complete JSON string literals because those are different inputs: one excludes quotes, the other must be a valid JSON string value. It is intentionally not a full JSON formatter, object editor or array validator. Processing happens locally in your browser.
Use string-content mode when you already have the surrounding JSON syntax and only need the inside of the string. Use complete-literal mode when you want a standalone value that can be parsed as JSON by itself. In both modes, the tool treats the result as text, not executable code. That distinction matters when escaped text moves through logs, APIs, databases and template systems that may each add or remove one escaping layer.
| Escape | Meaning |
|---|---|
\" | Double quote |
\\ | Backslash |
\/ | Forward slash |
\b | Backspace |
\f | Form feed |
\n | Line feed |
\r | Carriage return |
\t | Tab |
\u00E9 | U+00E9 |
\uD83D\uDE00 | U+1F600 |
String content:
Hello \"World\"
Complete string literal:
"Hello \"World\""
String content is the inside of the JSON string. A complete literal includes the opening and closing quotation marks and can be passed to JSON.parse() as one JSON value. Do not paste full objects or arrays into this tool; use a formatter or validator built for that job.
Literal Unicode is valid in UTF-8 JSON, so café 😀 does not need to become ASCII escapes unless a receiving system requires ASCII-only output. Escaped and literal forms can represent the same string, and JSON escaping does not normalize Unicode. A decomposed sequence such as e + U+0301 remains decomposed unless you explicitly enable normalization.
When ASCII-only output is selected, BMP characters such as é are written as one \uXXXX escape. Supplementary characters such as many emoji are written as two escapes because JSON's numeric escape form represents UTF-16 code units. The original code-point order is preserved. Combining marks, variation selectors, zero-width joiners and bidirectional controls are escaped or preserved according to the selected output style, but they are not removed.
Strict JSON \uXXXX notation represents UTF-16 code units. A supplementary character such as 😀, code point U+1F600, becomes \uD83D\uDE00 in ASCII-only JSON. Those two escapes must appear as a high surrogate followed by a low surrogate. Reversed or isolated surrogates are malformed and should not be accepted silently.
| Syntax | Strict JSON | JavaScript |
|---|---|---|
\u00E9 | Yes | Yes |
\uD83D\uDE00 | Yes | Yes |
\u{1F600} | No | Yes in modern JavaScript |
\xE9 | No | Yes |
\0 | No | Context-dependent |
\v | No | Yes |
"
→ \"
→ \\\"
Each escaping layer adds syntax for a different parsing step. Decode one layer at a time and stop when the data contract says the value is text. Never repeatedly unescape until the result “looks right”; that can damage legitimate backslashes.
Double escaping often appears when application code manually escapes a value before passing it to a JSON serializer. In most API code, the safer pattern is to keep an ordinary Unicode string in memory and let the JSON serializer write the final payload once. If a log line shows \\u00E9, inspect whether that is the actual stored value or only the logger's escaped representation.
If a malformed escape is reported, fix the source instead of switching to a JavaScript parser. Strict JSON does not allow \xXX, \u{...}, \0 or \v. Isolated surrogate escapes are also reported because they are not valid Unicode scalar values by themselves.
This tool runs in your browser. Your input is not submitted to UnicodeNow. The local runner places output in a textarea as text; it does not execute decoded content.
For complete objects, arrays or API documents, use a JSON validator or formatter that understands the whole grammar. This page is deliberately narrower: it helps you reason about the string layer where most quote, backslash, newline and Unicode escape bugs occur. That narrower scope makes the warnings easier to act on.
It converts characters such as quotation marks, backslashes and controls into valid JSON string escape syntax.
String content excludes surrounding quotation marks; a complete string literal includes them.
Use \" inside JSON string content.
Use \\ inside JSON string content.
No. Strict JSON uses \uXXXX, so supplementary characters use surrogate pairs.
Because strict JSON \uXXXX notation represents UTF-16 code units.
No. Literal UTF-8 Unicode is valid.
A string has been escaped more than once, creating additional backslash layers.
No. It processes JSON string content or complete JSON string literals.
No. Escape it for its destination context.
No, unless normalization is explicitly enabled.
No. This tool runs in your browser and does not submit input to UnicodeNow.
Encode and decode HTML named, decimal and hexadecimal entities.
Escape JavaScript string literals and decode JS escape notation without eval.
Escape and unescape PHP-style single and double quoted strings.
Convert Python string escapes without executing Python code.
Convert text to and from Unicode escape sequences and numeric entities.
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.
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.