JSON String Escape and Unescape
Escape quotes, backslashes and line breaks so text can sit inside a JSON string, or unescape an escaped string back to plain text.
Escape quotes, backslashes and line breaks so text can sit inside a JSON string, or unescape an escaped string back to plain text.
Inside a JSON string, characters such as double quotes, backslashes and line breaks must be escaped (\", \\ and \n). Doing it by hand is error-prone, especially for multi-line text or embedded JSON.
This tool escapes plain text for use inside a JSON string and unescapes strings back to readable text.
Input: He said "hi" Output: He said \"hi\"
No. You get the contents only, so you can drop it between your own quotes.
The string has an invalid escape such as a lone backslash or an unescaped double quote.
Yes. If the input starts and ends with a double quote, it is parsed as a JSON string.
No. It runs in your browser.