About this tool
Inside a JSON string, some characters must be escaped with a backslash: double quotes become \", backslashes become \\, and line breaks and tabs become \n and \t. This tool does that for any text you paste, and does the reverse: it turns an escaped JSON string back into readable text, or into formatted JSON when the string contains a JSON document.
JSON escape sequences
| Character | Escaped |
|---|---|
Double quote " | \" |
Backslash \ | \\ |
| Line feed (new line) | \n |
| Carriage return | \r |
| Tab | \t |
| Backspace, form feed | \b, \f |
| Other control characters (U+0000 to U+001F) | \u0000 … \u001f |
| Any character, optionally | \u00e9 for é; emoji as two \uXXXX surrogates |
Forward slashes may be escaped as \/ but don’t have to be; some systems do it so JSON can be embedded in an HTML <script> tag safely. Single quotes are never escaped in JSON.
Unescaping double-escaped JSON
A common sight in logs and message queues is JSON that was turned into a string and then put inside other JSON: "{\"event\":\"order.created\"}". Paste it here in Unescape mode and you get the original JSON back, pretty-printed. If it was escaped twice (backslashes everywhere, like \\\"), Undo double escaping keeps decoding until it reaches the real content.
Escape options
- Wrap in quotes: include the surrounding
"so the result is a complete JSON value. Turn it off to paste into an existing string. - Escape non-ASCII: writes characters like é, ✓ and emoji as
\uXXXX, for systems that only accept ASCII.
In code, JSON.stringify(text) (JavaScript) and json.dumps(text) (Python) escape a string, and JSON.parse / json.loads unescape it. For URLs, use the URL encoder instead; for HTML, entities like &.
FAQ
How do I escape a string for JSON?
Paste the text in Escape mode. Quotes, backslashes, line breaks, tabs and control characters are escaped, and the result is wrapped in double quotes so it is a valid JSON string.
How do I unescape a JSON string?
Switch to Unescape and paste the string, with or without its surrounding quotes. Escape sequences like \n, \" and \u00e9 are decoded. If the result is JSON, it is pretty-printed.
How do I convert an escaped JSON string back to JSON?
Paste the escaped string, for example "{\"a\":1}", in Unescape mode with “Pretty-print if the result is JSON” on. You get {"a": 1} back, formatted.
Do I need to escape forward slashes in JSON?
No. \/ is allowed but optional. Some serializers escape slashes so JSON can be placed inside an HTML script tag without accidentally closing it.
Do single quotes need escaping in JSON?
No. JSON strings use double quotes, so a single quote is an ordinary character. \' is actually invalid in JSON.