JSON Escape and Unescape

Escape plain text as a JSON string or decode one JSON string literal. Check quotes, backslashes and line breaks without changing the underlying text.

Open the Converter
Mode

Your input stays in this browser. Nothing is uploaded or saved.

Text limit: 1 MiB; XML/YAML nesting limit: 80 levels.

By YiyaoPublished Updated

Inspect one JSON string layer

Use JSON unescape when text has been serialized as a JSON string and you need to inspect the original value. Use Escape for the reverse task: turning plain text into a valid JSON string literal.

Choose the direction before converting. A JSON object, an HTML entity and a URL-encoded value are different representations. Identifying the layer first helps avoid repeated decoding that changes the intended content.

Choose the correct input mode

Escape accepts plain text and returns a complete JSON string literal, including its outer quotation marks. Unescape accepts one valid JSON string literal and returns its text value. Paste the entire quoted value rather than deleting its outer quotes.

Copy the output only after reviewing the selected mode. The tool presents the original and result as text, never as executable code or rendered markup.

Input taskModeResult
Text needs to become a JSON string valueEscapeQuoted JSON string literal
A quoted JSON string needs inspectionUnescapeOriginal text value
An object or array needs formattingNeither modeUse a JSON document parser or formatter
Text contains & or %20Review the source formatUse the matching entity or URL conversion

Check quotes and line breaks

The JSON literal "He said \"go\"." becomes the text He said "go". The literal "line1\nline2" becomes two lines. A Windows-style path needs escaped backslashes inside JSON: "C:\\data\\sample.json" becomes C:\data\sample.json.

For double-escaped input, inspect a single layer at a time. The literal "\\n" becomes the two characters backslash and n, not a line break. The tool does not keep decoding until the content looks different.

Escape mode converts quotes, a newline and backslashes into a JSON string literal.
Decode one JSON string layer and check the resulting text.

Use a strict parser for errors

An unfinished string, invalid escape sequence or raw line break inside a JSON literal should return an error. Objects, arrays, numbers, booleans and null are valid JSON values in other contexts, but they are rejected in this string-only tool.

If a value came from a larger API response, inspect it with a JSON parser first so you know whether it is already a string in memory. The visible slashes in a debugger can describe serialization rather than extra characters in the original data.

Connect decoding to collection review

A collected response may contain text fields that need inspection before field mapping. Confirm the response format and extract the intended field before using this tool. Keep the source URL and task record with your review notes.

After the string is readable, decide whether it is plain text or a second structured document. Parse another document only when the receiving workflow actually expects it; successful unescaping alone does not validate the contents.

For collection tasks, Explore Crawler Console. Local conversion remains a separate step.

Verify the round trip

Escape a harmless sample, unescape that complete result and compare it with the original. Include quotation marks, a backslash and a line break in the test. Equality of the original text and decoded text is the expected outcome.

Use sanitized examples for troubleshooting. Keep secrets and private response bodies out of shared screenshots or copied test cases.

JSON string questions

Why are the outer quotes required in Unescape mode? They identify a complete JSON string literal that can be parsed consistently.

Does unescaping make HTML safe to display? No. The result is text. An application must still use a safe rendering method for its destination.