JSON String Escape & Unescape
Escape text into a valid JSON string body, and back. This tool does both escape and unescape on one page — just pick a mode, paste your text, and click. Everything runs on your device, nothing is sent to a server.
Everything runs in your browser. Your data is never sent to our servers.
Example
Example Input
Line 1 He said "hi"
Example Output
Line 1\nHe said \"hi\"
How to Use
- 1Choose Escape or Unescape mode at the top.
- 2Type or paste your text into the Input field.
- 3Click the button (or press Ctrl+Enter) to process. The result appears in the Output field.
- 4Click Copy to copy the result, or "Swap input/output" to quickly reverse the operation.
About JSON String
JSON Escape turns plain text into a form safe to place inside a JSON string — escaping quotes ("), backslashes (\), newlines, tabs, and other control characters.
How it works: this tool uses JSON.stringify to produce correct escaping, then strips the wrapping quotes so you get just the string body. Unescape reverses the process.
JSON Escape is useful when you need to paste multiline or quote-containing text into a JSON file, API payload, or config without breaking the JSON format.
FAQ
Can this JSON String tool both escape and unescape?
Yes. This is a single page with a toggle — use Escape mode to transform text, and Unescape mode to reverse it. No need for two separate pages.
Is my data sent to a server?
No. JSON String is processed entirely in your browser. The text you enter never leaves your device.