What this JSON escape tool does
A JSON string can hold any text — but only if the characters that would break the syntax are escaped. Paste multi-line text, code, or anything containing quotes into a JSON document unescaped and the result won’t parse. This tool applies exactly the escaping the JSON specification defines, using the same serializer your runtime uses, so the output is correct by construction: quotes become \", backslashes become \\, newlines become \n, and control characters become \uXXXX sequences.
Unescape mode reverses the process — paste an escaped string (with or without its surrounding quotes) and read the original text.
How to escape text for JSON
- Choose Escape or Unescape.
- Paste your text — multi-line input is fine.
- For escaping, tick Include surrounding quotes if you want a complete string literal.
- Click the button and copy the result.
The classic use case: JSON inside JSON
Webhook payloads, message queues and audit logs often store one JSON document as a string field of another. Reading those nested payloads means unescaping the inner string first — paste the field value here, unescape, then pretty-print the result with the JSON Formatter. Writing them means the reverse: format the inner document, escape it here, and paste it in as a value.