JSON Escape and Unescape

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.

Processed locally in your browser

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.

Advanced options

JSON escaping does not require normalization. Enable it only when you intentionally want to change the Unicode sequence.

Escaping forward slashes is valid but usually unnecessary in modern JSON.

Paste plain text or strict JSON string escape content. Input remains local to this browser.

What this JSON escape tool does

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.

Common JSON escape sequences

EscapeMeaning
\"Double quote
\\Backslash
\/Forward slash
\bBackspace
\fForm feed
\nLine feed
\rCarriage return
\tTab
\u00E9U+00E9
\uD83D\uDE00U+1F600

JSON string content vs a complete JSON string literal

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.

Unicode characters in JSON

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.

Emoji and surrogate pairs

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.

JSON escapes vs JavaScript escapes

SyntaxStrict JSONJavaScript
\u00E9YesYes
\uD83D\uDE00YesYes
\u{1F600}NoYes in modern JavaScript
\xE9NoYes
\0NoContext-dependent
\vNoYes

Avoid double escaping

"
→ \"
→ \\\"

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.

How to use the tool

  1. Choose Escape or Unescape.
  2. For escaping, choose string content, complete literal or ASCII-only literal.
  3. Choose whether Unicode should remain literal or be escaped.
  4. For unescaping, choose whether the input is string content or one complete JSON string literal.
  5. Use Advanced options only when you intentionally need slash escaping or normalization.
  6. Review errors, warnings and statistics before copying or downloading the UTF-8 output.

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.

Privacy and processing

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.

Common uses

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.

Frequently asked questions

What does JSON escaping do?

It converts characters such as quotation marks, backslashes and controls into valid JSON string escape syntax.

What is the difference between JSON string content and a JSON string literal?

String content excludes surrounding quotation marks; a complete string literal includes them.

How do I escape quotation marks in JSON?

Use \" inside JSON string content.

How do I escape a backslash in JSON?

Use \\ inside JSON string content.

Is \u{1F600} valid JSON?

No. Strict JSON uses \uXXXX, so supplementary characters use surrogate pairs.

Why can an emoji use two Unicode escapes?

Because strict JSON \uXXXX notation represents UTF-16 code units.

Does JSON require non-ASCII characters to be escaped?

No. Literal UTF-8 Unicode is valid.

What is double-escaped JSON?

A string has been escaped more than once, creating additional backslash layers.

Can this tool parse full JSON objects?

No. It processes JSON string content or complete JSON string literals.

Is unescaped output safe to insert into HTML?

No. Escape it for its destination context.

Does JSON escaping normalize Unicode?

No, unless normalization is explicitly enabled.

Is my text uploaded?

No. This tool runs in your browser and does not submit input to UnicodeNow.

Related tools

PHP Escape and Unescape

Escape and unescape PHP-style single and double quoted strings.

DeveloperProcessed locally

Unicode Escape Converter

Convert text to and from Unicode escape sequences and numeric entities.

DeveloperProcessed locally

XML Escape and Unescape

Escape and decode XML entities and numeric character references.

DeveloperProcessed locally

Unicode Character Inspector

Inspect each Unicode character, encoding, category, script and normalization form.

UnicodeProcessed locally

Byte Length Calculator

Count UTF-8 bytes, code points, grapheme clusters and UTF-16 code units for text.

EncodingProcessed locally

Related guides

Unicode vs UTF-8

Unicode defines characters and code points. UTF-8 encodes those code points as bytes for files, databases, web pages, APIs and network messages.

What Is a Unicode Code Point?

Learn what Unicode code points are, how U+ notation works, and how code points differ from glyphs, bytes, code units and visible characters.

Unicode Normalization Explained

Learn NFC, NFD, NFKC and NFKD, canonical and compatibility equivalence, and safe normalization for comparison, search and identifiers.