Online JSON Escape & Unescape Tool

Escape quotes, newlines, and backslashes for string literals, or decode stringified JSON back into readable JSON.

Runs locally 0 lines • 0 bytes Ready
Tip: drop a file anywhere on the page
Input
Paste, type or drop a file
Result
Updates as you type
// Output will appear here…
About this tool

How the JSON Escape / Unescape works

Escape and unescape JSON strings online. Safely format JSON for string literals, cURL commands, environment variables, and API payloads.

How to use the JSON Escape / Unescape

  1. Paste JSON you want to embed inside a string.
  2. Escape it, or switch to Unescape to turn a stringified value back into JSON.
  3. Copy the result into your code, log or request body.

JSON Escape / Unescape example

Input
Escape:   {"msg":"Hi"}
Unescape: "{\"msg\":\"Hi\"}"
Result
{\"msg\":\"Hi\"}
{"msg":"Hi"}

When to use it

  • Putting JSON inside another JSON string, for example in a webhook payload.
  • Reading double-encoded JSON from logs and message queues.
  • Embedding JSON in source-code string literals.

Tip: If a value shows backslashes before every quote, it has been stringified twice; unescape it once to get the real JSON.

String Literal Escaping

Converts raw JSON into a properly escaped string with \", \n, \t, and \\ for cURL, code, and env vars.

Unescape Stringified JSON

Decodes double-escaped strings (like stringified logs or API responses) back into readable JSON.

One-Click Format on Unescape

Automatically beautifies unescaped JSON so you can inspect it immediately.

Real-Time Toggle

Switch seamlessly between Escape mode and Unescape mode with one click.

FAQ

Common questions

When should I escape JSON?

Escape JSON when embedding a payload inside another JSON string, an environment variable, a cURL command line, or a programming language string literal.

What does Unescape do?

Unescape takes a string containing escaped characters like \" and \n and restores them to their raw unescaped values.

What characters are escaped?

Double quotes (\"), backslashes (\\), newlines (\n), carriage returns (\r), and tabs (\t).

Is this conversion safe for sensitive API tokens?

Yes! Everything executes in your local browser, so no sensitive payloads are ever sent over the network.