Escape or unescape JSON strings with quotes and special characters.
Escape text so it can sit inside a JSON string, or unescape a JSON string back to plain text. Quotes, backslashes, line breaks and control characters are handled the way JSON.stringify does. It is handy for embedding multi-line text, logs or code snippets in JSON payloads and for reading escaped strings from logs.
JSON strings are wrapped in double quotes, so a few characters cannot appear as-is inside them. The double quote must be written as a backslash and a quote, a backslash must be doubled, and control characters such as newline and tab are written as backslash n and backslash t. Other control characters use a backslash u sequence with four hex digits. Characters like accented letters can be left as they are in UTF-8. Escaping lets arbitrary text be stored safely as a JSON value, and unescaping reverses it. Forgetting to escape is a common cause of JSON parse errors.
No. It returns only the escaped contents, so you can add the quotes yourself where you place it.
Double quotes, backslashes, and control characters such as newline, tab and carriage return. Other text is unchanged.
No. The tool unescapes a single JSON string value. To work with objects, use a JSON formatter.
A single backslash begins an escape sequence in JSON, so a literal backslash must be written as two.
Yes. A backslash u followed by four hex digits is turned into that character when unescaping.