JSON Escape / Unescape
Escape text or a whole JSON document so it can be embedded inside a JSON string — or unescape a string full of \" and \n back into readable text. Handles quotes, backslashes, control characters, emoji and Unicode exactly.
What Is JSON Escaping?
Making text safe to put between the double quotes of a JSON string.
Inside a JSON string, some characters have to be written as escape sequences: a double quote becomes \", a backslash \\, a line break \n, a tab \t, and other control characters \u0000–\u001F. Everything else — including emoji and any language — may appear as-is.
You need this whenever text goes into JSON by hand: a multi-line message in a config file, an HTML snippet in an API payload, a Windows path, or a whole JSON document stored as a string field (common in logs, queues, webhooks and Elasticsearch).
Unescape does the reverse: paste a string like "{\"user\":\"ada\",\n...}" from a log file and get the original text back, pretty-printed if it is JSON. If the result is still escaped (double-encoded), the tool tells you — click Swap to unescape again.
Escaping uses the same rules as JSON.stringify, so the output is always valid and round-trips exactly, including emoji and unpaired surrogates.
JSON Escape Sequences
The complete list from RFC 8259 — nothing else is allowed after a backslash.
| Character | Escaped | Notes |
|---|---|---|
Double quote " | \" | Required |
Backslash \ | \\ | Required — e.g. C:\\Users |
| Line feed | \n | Required (raw line breaks are invalid) |
| Carriage return | \r | Required |
| Tab | \t | Required |
| Backspace / form feed | \b / \f | Required |
| Other control chars U+0000–U+001F | \u0000… | Required |
Slash / | \/ | Optional — useful inside HTML <script> |
| Any Unicode character | \u00e9, \ud83d\ude00 | Optional — emoji use a surrogate pair |
How to Use the JSON Escape/Unescape
Get your result in under ten seconds.
Pick a mode
Escape turns text into a JSON string literal; Unescape turns an escaped string back into text.
Paste your input
The result updates as you type. Options let you skip the surrounding quotes, escape Unicode or slashes, or minify JSON first.
Copy, download or swap
Copy the result, download it, or Swap to feed it back in — useful for double-escaped strings.
Why Use the JSON Escape/Unescape on Developers Web Tools
Fast, accurate and private — built for developers.
Always valid
Escaping follows JSON.stringify exactly — the output always parses back to your original text.
Both directions
Escape and unescape on one page, with Swap to chain them.
Unicode-safe
Emoji and every script are kept, or written as \uXXXX for ASCII-only systems.
Double-escape detection
Spots strings that are still escaped after one pass.
Precise errors
Invalid escapes like \x or \u12 are reported with line and column.
Private
Runs entirely in your browser — safe for tokens and payloads.
Frequently Asked Questions
When you put text into a JSON string by hand — or store an entire JSON document as a string value (for example a payload field in a log or message queue). Without escaping, quotes and line breaks in the text would break the outer JSON.
Nothing, practically: escaping text produces exactly what JSON.stringify(text) returns in JavaScript or json.dumps(text) in Python. Untick Wrap in quotes if you only want the inside of the string.
JSON allows \/ but doesn't require it. It matters when JSON is embedded in an HTML <script> tag: a literal </script> inside a string would end the script early. Escaping slashes prevents that.
A string that was escaped twice, such as "{\\\"a\\\":1}". One unescape gives another escaped string. The tool detects this and suggests Swap to unescape again.
Yes. If the input is a complete quoted JSON string, it's decoded as one. Otherwise the escapes in your text are decoded directly, and literal line breaks are kept as they are.
No. All processing happens in your browser.