How to use it
- Choose Escape to turn text into a JSON string, or Unescape to turn a JSON string back into text.
- Paste your text. The result appears automatically.
- Untick Outer quotes to leave out the surrounding quotes, for example when the text goes inside an existing string.
What changes when you escape
| Text | In 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.
He said "hi" and left.
Path: C:\temp\demo
Café ✓"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 \".