JSON Escape / Unescape
Escape a raw string into a JSON-safe literal, or unescape a JSON string literal back to plain text.
About this tool
The JSON Escape / Unescape tool converts plain text into a properly escaped JSON string literal, and reverses the process — turning an escaped JSON string body back into the original readable text. This is the operation you need whenever you're manually embedding a multi-line, quote-containing, or special-character string into a JSON document by hand, or trying to read a string literal that's come back full of \n and \" sequences.
Escaping uses the browser's built-in JSON.stringify, which correctly handles every character JSON requires escaping — double quotes, backslashes, newlines, tabs, carriage returns, and control characters — then strips the surrounding quote pair so you get just the escaped body, ready to paste inside your own "..." in a JSON document. Unescaping does the reverse: it wraps your input in quotes and parses it as a JSON string, which correctly interprets \n as a newline, \" as a literal quote, \\ as a single backslash, and \uXXXX Unicode escapes as their actual characters.
Invalid escape sequences — an unescaped control character, a malformed \u escape, or a stray unescaped quote — are caught and reported clearly rather than silently producing corrupted output. Everything runs locally using the browser's native JSON engine; no text is transmitted anywhere. Common uses: hand-editing a JSON config file with a multi-line string value, debugging a string that looks "double-escaped" from being JSON-encoded twice, or preparing a string literal for a curl -d payload.
