Step 1: Paste text
Paste raw text to escape, or one quoted JSON string to unescape.
Escape raw text into a JSON string, or unescape one JSON string back to text. Escape includes the surrounding double quotes. The text stays in your browser.
JSON string escaping makes quotes, backslashes, and line breaks safe inside a JSON string. You can escape JSON online or unescape JSON online on this page. The result is a JSON string escape, not URL encoding and not HTML encoding.
Escape reads the input as raw text. If you paste an already escaped string and choose Escape again, the quotes and backslashes are escaped a second time. Use Unescape to reverse one level.
Paste raw text to escape, or one quoted JSON string to unescape.
Choose Escape or Unescape. The status line reports success or the problem.
Escaped output includes the surrounding double quotes. Unescape removes them.
Copy output takes the full result. Clear empties both boxes.
say "hi"
"say \"hi\""
a\b
"a\\b"
The second Escape treats the first result as raw text, so the quotes and backslashes are escaped again:
"say \"hi\""
"\"say \\\"hi\\\"\""
A newline becomes \n and a tab becomes \t.
Characters such as 東京 and emoji stay as themselves.
The line separators U+2028 and U+2029 are written as \u2028 and \u2029.
Unescape accepts one JSON string, including the surrounding double quotes. Whitespace around that string is allowed. Text after the closing quote is rejected.
\x41, \a, a short \u12, and an unpaired
\uD800 are rejected. An object, array, number, boolean, or null is
rejected. The output box is cleared when conversion stops.
No. Escape, unescape, and copy all run in your browser.
Escape adds the surrounding double quotes. Unescape requires those quotes and returns the text inside them.
Use the JSON Beautifier to format a document, the JSON Viewer to inspect a tree, or the JSON to CSV and JSON to YAML tools when you need another format.