What is escaped
A JSON string is written between double quotes. All characters may sit inside the quotes except the ones that must be escaped: the quotation mark, the backslash and the control characters U+0000 through U+001F [1]. Common characters have short forms; the rest of the controls use \u00XX.
" → \" \ → \\ line break → \n tab → \t carriage return → \r other control → \u00XX
Unescape reads the same grammar strictly. It accepts \" \\ \/ \b \f \n \r \t and \uXXXX, joins a surrogate pair into one character, and stops at the first problem with a message that says what is wrong and where.
Example
Input (a quote, a backslash-n typed as two characters, a tab, and non-ASCII): He said "hi"\n café 😀
- Escape with quotes:
"He said \"hi\"\\n\tcafé 😀" - Escape without quotes, non-ASCII as escapes:
He said \"hi\"\\n\tcaf\u00e9 \ud83d\ude00 - Unescape either one and you get the input back.
Questions
Does my text leave my device?
No. The page works in your browser and sends nothing anywhere. It makes no network request while you type or paste.
Which characters must be escaped?
The quotation mark, the reverse solidus (backslash) and the control characters U+0000 to U+001F [1]. Everything else may be written as it is. This tool does not escape the forward slash.
What does “non-ASCII as \u” do?
It writes every character outside plain ASCII as \uXXXX. A character outside the Basic Multilingual Plane, such as an emoji, becomes two escapes (a surrogate pair), the 12-character form in the RFC [1].
What if the text has an unpaired surrogate?
Escape always writes it as \uXXXX so the output is valid. Unescape accepts an unpaired surrogate escape but warns you, because software can treat such text differently [2].
How are errors reported?
With what is wrong and where: the line and column of the first problem, such as an unescaped quote, a raw line break, an escape like \x that JSON does not have, or a \u without four hex digits.