JSON Escape & Unescape
Escape raw text or JSON into a safe JSON string literal, or unescape stringified JSON payloads.
Related data tools
All Data toolsJSON ↔ YAML Converter
Convert seamlessly between JSON and YAML with validation and indentation control.
JSON to TypeScript Types
Infer clean TypeScript interfaces or type aliases from any JSON payload with nested models.
About JSON Escape & Unescape
Escape raw multiline strings, logs, or JSON payloads into valid JSON string literals—or unescape escaped JSON strings back into readable text with optional auto-formatting.
How to use JSON Escape & Unescape
- 1
Select Escape String or Unescape String.
- 2
Paste raw text/JSON to escape or an escaped string containing \n, \", or \\ sequences to unescape.
- 3
Toggle outer quotes or JSON auto-formatting as needed, then copy the clean result.
Frequently asked questions
Why would I escape JSON into a string?
Escaping is needed whenever you embed a JSON document inside another JSON string field, an environment variable, a log fixture, or a code snippet.
What happens if I unescape a string that contains nested JSON?
Enable "Auto-format if unescaped text is valid JSON" and the tool will automatically pretty-print the decoded inner JSON object or array.
Does it preserve Unicode characters and line breaks?
Yes. Standard JSON.stringify and JSON.parse handle newlines, tabs, quotes, backslashes, and Unicode sequences accurately.
