How to use the JSON Escape & Unescape
- Choose a mode: escape or unescape text, or convert between a JSON document and an escaped string.
- Paste the input; the output updates instantly.
- Use Reverse to run the opposite conversion on the result.
Which characters must be escaped in JSON?
| Character | Escape |
|---|---|
Double quote " | \" |
Backslash \ | \\ |
| Newline, carriage return, tab | \n, \r, \t |
| Backspace, form feed | \b, \f |
| Other control characters (U+0000–U+001F) | \u0000–\u001f |
Everything else, including emoji and accented letters, is allowed as-is in UTF-8 JSON. Tick ASCII only to write non-ASCII characters as \uXXXX for systems that cannot handle UTF-8. The forward slash may optionally be escaped as \/, which some servers do to keep </script> out of inline JSON.
JSON inside JSON
Some APIs and message queues carry a JSON document as a string field — for example an SQS message body or a webhook payload. JSON → string produces that double-encoded form; String → JSON removes one layer of escaping and pretty-prints the inner document, which is the quickest fix for the dreaded "{\"id\":1}" in logs.
In code
JSON.stringify(text) // escape (JavaScript)
JSON.parse(escaped) // unescape
json.dumps(text) # Python
json.loads(escaped)
Need URL or HTML escaping instead? Use the URL encoder or HTML entity encoder.
Tools that pair well with the JSON Escape & Unescape
- Base64 Encode / Decode — Convert text to Base64 and back with full UTF-8 support (accents, emoji), switch to URL-safe Base64, or drop a file to get its Base64 string or data URI.
- JSON Diff — Find exactly what changed between two JSON documents — API responses, config versions, fixtures or exports — as a list of paths with old and new values.
- JSON to YAML — Paste JSON and get clean YAML for Kubernetes manifests, Docker Compose, GitHub Actions or any config file.
- YAML to JSON — Paste YAML — a Compose file, Kubernetes manifest or CI config — and get formatted JSON.
Frequently asked questions
How do I remove backslashes from a JSON string?
\" and \n are turned back into the real characters.