JSON Escape and Unescape

Free. No sign-up. Your input is processed in your browser.

Turn any text into a JSON string, or a JSON string back into readable text.

How to use it

  1. Choose Escape to turn text into a JSON string, or Unescape to turn a JSON string back into text.
  2. Paste your text. The result appears automatically.
  3. Untick Outer quotes to leave out the surrounding quotes, for example when the text goes inside an existing string.

What changes when you escape

TextIn a JSON string
"\"
\\\
A new line\n
A tab\t
Other control characters\u0001 and similar

Tick Escape non-ASCII to also write letters such as é or ✓ as \u00e9 or \u2713, for systems that accept only ASCII.

JSON inside JSON

Logs and APIs sometimes store a whole JSON document as one string, full of \". Unescape it, and if the text inside is JSON the tool says so; paste it on the JSON formatter to read it.

Example

Made-up input, and what JSON Escape and Unescape returns for it.

Input
He said "hi"	and left.
Path: C:\temp\demo
Café ✓
Result
"He said \"hi\"\tand left.\nPath: C:\\temp\\demo\nCafé ✓"

Questions

Is this the same as JSON.stringify?

For a text value, yes: escaping gives the same result as JavaScript’s JSON.stringify.

Can I unescape text without the outer quotes?

Yes, as long as every quote inside is written as \".

Related tools

See all tools