JSON Tool
JSON Escape/Unescape
Escape JSON for embedding in strings or unescape escaped JSON. Handle special characters properly.
JSON Input
Loading editor...
Escaped Output
Loading editor...
About JSON Escaping
JSON escaping converts special characters in a string to their escape sequences, making the JSON safe to embed in other strings or code.
Characters That Need Escaping
\(backslash) →\\"(double quote) →\"- Newline →
\n - Carriage return →
\r - Tab →
\t
Common Use Cases
- Embedding JSON in JavaScript string literals
- Storing JSON in database text fields
- Passing JSON through APIs that dont support raw JSON
- Including JSON in HTML attributes
Example
Original JSON:
{"message": "Hello\nWorld"}Escaped for embedding in a JavaScript string:
"{\"message\": \"Hello\\nWorld\"}"