Paste a string and click Escape to produce a JSON-safe version with special characters escaped — or click Unescape to strip escape sequences and recover the original text. Useful when embedding strings inside JSON payloads or extracting content from serialized data.
Free, fast, runs in your browser. No login needed.
\" back to " and \\ back to \.Escaping uses JSON.stringify(input). This is the correct and complete approach — it handles every character that must be escaped in a JSON string: double quotes (\"), backslashes (\\), newlines (\n), tabs (\t), carriage returns (\r), and all Unicode control characters. The output includes the surrounding double-quote characters, making it a valid JSON string literal you can paste directly into a JSON document.
Unescaping is a partial operation. The tool strips the surrounding "..." quotes, converts \" back to ", and converts \\ back to \. It does not convert other escape sequences: \n remains as the two characters backslash and n (not an actual newline), and \t, \r, \uXXXX, \b, \f are similarly left as literal text.
If you need full unescape including newlines and Unicode sequences, paste the escaped string into the JSON Formatter instead: wrap it in a JSON object like {"v": "your\nstring"}, format it, then copy the value. The formatter's JSON.parse() handles the complete escape specification.
Common use cases: escaping a string before inserting it as a value in a JSON template; unescaping a stringified JSON snippet that was double-serialized; preparing text for inclusion in a JSON configuration file.
All characters required by the JSON spec: double quotes, backslashes, newlines (\n), tabs (\t), carriage returns (\r), backspace (\b), form feed (\f), and Unicode control characters below U+0020. The output is a valid JSON string literal including surrounding double quotes.
The unescape direction only handles \" and \\ sequences. It does not process \n, \t, \r, or \uXXXX. For full unescape, wrap the string in {"v": "your escaped string"} and run it through the JSON Formatter, which uses JSON.parse() to handle the complete spec.
Escape produces a valid JSON string literal — the surrounding double quotes are part of the JSON value representation. If you only want the escaped content without quotes, remove the first and last character from the output.
Sometimes JSON gets serialized twice — a JSON object is stringified, and then that string is stored as a value inside another JSON document. You get something like "{\"key\": 1}". Unescape once to get the inner JSON string, then format it as JSON.
No. Both escape and unescape run entirely in your browser.