In short: JSON string escaping turns quotes, backslashes, newlines and control characters into sequences like \" and \n so text can sit safely inside a JSON string; unescaping reverses it.
About JSON String Escape & Unescape
Embedding a block of text — an HTML snippet, an error message, a multi-line prompt — inside a JSON payload requires escaping double quotes, backslashes and line breaks. Getting one wrong produces invalid JSON. Going the other way, log files and API responses often show strings full of \n and \" that are hard to read.
Escaping here follows the JSON specification exactly (it uses JSON.stringify), optionally converting all non-ASCII characters to \uXXXX for systems that cannot handle UTF-8. Unescaping accepts the string with or without its surrounding quotes.
How to use JSON String Escape & Unescape
- Paste your text or escaped string.
- Press Escape or Unescape.
- Copy the result.
Examples
Say "hi" on two lines → Say \"hi\"\non two lines
"Error:\n at line 3\t(col 7)" → the message with real line breaks and tabs.
Frequently asked questions
Is this the same as JavaScript string escaping?
A JSON-escaped string is also a valid JavaScript string literal in double quotes. JavaScript additionally allows single-quoted and template strings with different rules.
Why does unescape fail?
The input must be a valid JSON string body. A lone backslash, an invalid \x sequence or an unescaped double quote will fail; the error says where.
Does it escape forward slashes?
No — / does not need escaping in JSON, although \/ is accepted when unescaping.
Is my text uploaded?
No. Everything runs in your browser. You can check this yourself: open your browser’s developer tools, switch to the Network tab and use the tool — no request carries your input.
Updated November 2026 · Free, no signup · How we build and test tools