About this tool
Escape a raw string for JSON or turn an escaped string back into plain text, all in your browser.
Escape runs your text through JSON.stringify and removes the surrounding quotes, so the result can sit inside a JSON string. Double quotes and backslashes get a backslash, line breaks and tabs become \n and \t, and other control characters become JSON escapes such as \u0001. Accented letters and emoji are left as they are.
Unescape accepts the text with or without its outer quotes and decodes it as a JSON string, so escapes such as \n, \", \/ and \uXXXX are understood. A bare double quote or a raw line break inside the text is rejected with "not a valid JSON string".