JSON Escape / Unescape
Escape text into a JSON string or unescape a JSON string back to raw text.
Text is escaped and unescaped locally in your browser, and nothing is uploaded to a server.
Need to format a whole document? Try the JSON Formatter.
About JSON Escape / Unescape
JSON escape and unescape any text right in your browser: this tool turns raw text into a valid JSON string and decodes an escaped JSON string back to readable text. Escaping converts double quotes, backslashes, newlines, tabs and other control characters into their JSON sequences (\", \\, \n, \t) so a value can be safely embedded in a JSON document, config file or code literal. Unescaping a JSON string does the reverse, restoring multi-line text. It is built for developers assembling API payloads, dropping log lines into JSON, or reading an escaped value pulled out of a config. Toggle whether the escaped output is wrapped in surrounding quotes. Everything is processed locally in your browser, so the text you paste never leaves your device and nothing is uploaded to a server.
Features
- Escape text into a JSON-safe string with one click
- Unescape a JSON string back to raw, multi-line text
- Handles quotes, backslashes, newlines, tabs and control characters
- Correctly escapes Unicode and non-printable characters
- Optionally wrap the escaped output in surrounding quotes
- Accepts a full quoted literal or bare escaped content when unescaping
- Tolerates literal line breaks in input when unescaping
- Copy or download the converted result
How to use the JSON Escape / Unescape
- Choose Escape to encode text, or Unescape to decode a JSON string.
- Paste your text or escaped string into the input box.
- For Escape, toggle Wrap in quotes depending on whether you need the surrounding quotes.
- Read the converted result on the right.
- Click Copy or Download to reuse it.
Example
Input
She said "hi"
Output
"She said \"hi\""
Text escaped into a JSON string literal (Wrap in quotes on).
Common errors & troubleshooting
- Unescape reports an unexpected token or invalid string. — Make sure the input is a properly escaped JSON string — raw double quotes inside the text must be written as \" before they can be unescaped.
- The escaped output has quotes around it that you did not want. — Turn off Wrap in quotes to get just the escaped content without the surrounding double quotes.
- A lone backslash in the input breaks unescaping. — Each backslash must be doubled (\\) in a valid JSON string; escape the text first, then unescape the result.
Frequently asked questions
- What is a JSON escape tool?
- A JSON escape tool converts characters that are special in JSON — double quotes, backslashes, newlines and tabs — into escape sequences such as backslash-quote and backslash-n, so the text becomes valid inside a JSON string. This tool also reverses the process to unescape a string.
- How do I escape a string for JSON?
- Pick Escape, paste your text, and the JSON-safe string appears instantly. Leave Wrap in quotes on for a complete quoted literal, or turn it off to get just the escaped inner content.
- How is this different from the JSON Formatter?
- The JSON Formatter beautifies or minifies a whole JSON document. This JSON Escape tool encodes or decodes a single string value so you can embed text in JSON or read an escaped value.
- Can I unescape JSON content without the surrounding quotes?
- Yes. The unescape mode accepts either a full quoted literal or just the escaped inner content and decodes both back to raw text.
- Does the JSON Escape tool handle multi-line text?
- Yes. Newlines are escaped to backslash-n when escaping and restored to real line breaks when unescaping, and literal line breaks pasted into the input are tolerated.
- Is my text sent anywhere when I escape JSON?
- No. Escaping and unescaping are processed entirely in your browser, so the text you paste never leaves your device and nothing is uploaded to a server.
Related tools
All ArrayKit tools