Skip to main content

Continue exploring

What's Next?

Jump straight into adjacent tools while the same JSON context and workflow are still fresh.

JSON Escape / Unescape: Decode Escaped JSON Strings

When JSON is embedded inside another string — in API responses, LLM tool-call results, database fields, or log lines — the inner JSON is escaped: quotes become \", newlines become \n, and the whole value is wrapped in outer quotes. This tool reverses that in one click.

  • Unescape: Paste an escaped JSON string literal → get readable, pretty-printed JSON.
  • Escape: Paste a JSON object or array → get an escaped string literal ready to embed in code.
  • Expand nested JSON (formatter toolbar): Paste any JSON document → every string value that contains valid JSON is expanded inline.
  • Privacy-first: All processing runs in your browser. Nothing is uploaded.

What Is an Escaped JSON String?

JSON only allows strings as property values, not raw JSON objects. So when a system needs to embed a JSON payload inside a string field (for example, an LLM storing a tool-call response, a database column, or an HTTP header), it serialises the inner JSON as a string. The result is JSON inside JSON — the outer document is valid JSON, but one of its string values happens to contain more JSON with escape sequences instead of raw characters.

Character Escaped form Meaning
" \" Double quote
\ \\ Backslash
(newline) \n Newline
(carriage return) \r Carriage return
(tab) \t Tab
(backspace) \b Backspace
(form feed) \f Form feed
Common use cases

When Do You Need to Unescape JSON?

LLM Tool-Call Responses

Frameworks like Claude, OpenAI, and Gemini return tool results as a text string inside a content array. That string is often a full JSON payload — escaped and embedded. Paste the full response and click Expand in the formatter to read it instantly.

Database String Columns

JSON payloads stored in TEXT or VARCHAR columns arrive as escaped strings when you query them. Unescape to inspect the structure before migrating to a proper JSONB column.

Embedding JSON in Code

Use Escape mode to convert a JSON object into a string literal you can paste directly into JavaScript, Python, or a curl command. Complement with our JSON Stringify tool for full JSON.stringify() control.

Expand Nested JSON in the Formatter

The main JSON Formatter has an Expand button in the toolbar. It walks every value in your document recursively and replaces any string that contains valid JSON with the parsed object or array — letting you see the full structure at a glance. This is ideal for API responses from AI frameworks where tool-call payloads arrive double-serialised.


Frequently Asked Questions

Is my data safe with this JSON tool?

Yes. This tool uses 100% client-side processing. Your JSON data never leaves your browser and is never sent to our servers, ensuring maximum privacy and security.

Does this tool work offline?

Once the page has loaded, all processing happens locally in your browser. You can disconnect from the internet and the tool will continue to work — no server connection is required to format, validate, or convert your JSON.

Is there a file size limit?

No server-side limits apply because everything runs in your browser. Practical limits depend on your device's memory, but modern browsers handle JSON files of tens of megabytes without issue.

What does 'escape JSON' mean?

Escaping JSON means converting a JSON value into a string literal that can be safely embedded inside another string or codebase. Characters like double quotes become \", backslashes become \\, and newlines become \n. The result is wrapped in outer quotes, e.g. {"key":"val"} becomes "{\"key\":\"val\"}".

What does 'unescape JSON' mean?

Unescaping JSON means taking a string that contains escaped JSON (e.g. "{\"name\":\"Alice\"}") and converting it back to a readable JSON object. This tool strips the outer quotes, reverses all escape sequences, then pretty-prints the result.

Why do I see \n and \" in my JSON string?

These are JSON escape sequences. \n represents a newline character and \" represents a literal double quote inside a string. You typically see them when JSON has been serialised twice — for example, when an API response embeds a JSON payload inside a string field. Use the Unescape mode to expand it back to readable JSON.

What is the 'Expand nested JSON' button in the formatter?

The Expand button in the main JSON formatter walks your entire JSON document and looks for any string values that are themselves valid JSON. It replaces each such string with the parsed object or array inline. This is especially useful for LLM tool-call responses, database fields, or API replies where a JSON payload has been double-serialised into a string.