Richscripts

JSON escape and unescape

Put any text inside a JSON value safely, or turn \"Hello\"\n back into the original text.

Private: everything happens in your browser. Nothing you type or choose is uploaded.

Direction

How to use it

  1. Choose Escape or Unescape.
  2. Paste your text.
  3. Copy the result into your JSON.

Questions and answers

Which characters are escaped?

Double quotes, backslashes and control characters such as new lines (\n), tabs (\t) and carriage returns (\r), exactly as JSON.stringify does.

Can I paste a string with its quotes?

Yes. When unescaping, surrounding double quotes are optional.

Is this the same as JavaScript string escaping?

Almost: JSON always uses double quotes and does not allow single-quote escapes.

Encoding tools