Normal JSON (Unescaped)
{"msg": "Hi \"dev\"\nOK"}Standard JSON object ready for JSON.parse(). Backslashes only appear inside string values.
Instantly unescape double-escaped JSON strings from logs or escape raw JSON and text into valid RFC 8259 string literals—auto-detected as you paste, 100% locally in your browser.
JSON strings cannot contain raw double quotes, unescaped backslashes, or literal ASCII control characters (U+0000 through U+001F such as newlines and tabs). When backend services serialize a JSON payload inside another JSON field—common in Kibana, CloudWatch, Kafka, webhook logs, and Java/Go error wrappers—each serialization pass adds another layer of backslashes. This tool inspects your pasted text automatically, strips single or nested escape layers, and formats valid JSON without leaving your browser.
Every legal backslash escape defined by the official JSON specification and the parsing error triggered when left unescaped.
| Escape | Code Point | Character | Why it matters in APIs & logs |
|---|---|---|---|
\" | U+0022 | Quotation mark (") | Must be escaped inside JSON strings; leaving it raw breaks JSON.parse with Unexpected token. |
\\ | U+005C | Reverse solidus (\) | Required for Windows file paths (C:\Users\dev) and regex patterns embedded in JSON. |
\/ | U+002F | Solidus (/) | Optional in pure JSON, useful when embedding JSON inside HTML <script> tags to prevent </script> injection. |
\n | U+000A | Line Feed (LF) | Raw multiline breaks inside strings are illegal in strict JSON; always serialize as \n. |
\r | U+000D | Carriage Return (CR) | Windows CRLF line endings serialize as \r\n inside JSON strings. |
\t | U+0009 | Horizontal Tab | Literal tab characters (0x09) inside strings fail strict RFC 8259 parsers unless encoded as \t. |
\b / \f | U+0008 / 000C | Backspace / Form Feed | Legacy control bytes rarely needed intentionally; often leak in from scraped PDFs or terminal logs. |
\uXXXX | U+0000–FFFF | 4-Hex Unicode Escape | Encodes any BMP character (e.g. \u4e2d); Emoji above U+FFFF use UTF-16 surrogate pairs like \uD83D\uDE00. |
Count the backslashes before a quote to tell immediately how many times a payload was stringified.
{"msg": "Hi \"dev\"\nOK"}Standard JSON object ready for JSON.parse(). Backslashes only appear inside string values.
"{\"msg\": \"Hi \\\"dev\\\"\\nOK\"}"Produced by one JSON.stringify() call or a JSON field storing serialized JSON (common in AWS API Gateway & webhooks).
"\"{\\\"msg\\\":\\\"Hi\\\"}\""Produced when an already-escaped JSON string is logged inside another JSON envelope (Kibana, CloudWatch, Sentry). Auto mode unwraps all layers at once.
Production-safe recipes across JavaScript, Python, jq, and Go.
// Escape JSON object to string literal
const escaped = JSON.stringify(JSON.stringify({ msg: 'Hello "world"\nLine 2' }))
// Unescape (handles double-escaped payloads safely)
let value = escaped
while (typeof value === 'string') {
try { value = JSON.parse(value) } catch { break }
}import json
# Escape text or JSON into a JSON string literal
escaped = json.dumps('{"msg": "Hello\nWorld"}')
# Unescape JSON string literal back to Python dict
decoded = json.loads(escaped)
if isinstance(decoded, str):
decoded = json.loads(decoded)# Unescape a JSON string logged in Kibana / CloudWatch
echo '"{\"ok\":true,\"msg\":\"line1\\nline2\"}"' | jq -r . | jq .
# Escape raw file contents into a single JSON string
jq -Rs . payload.txt// Escape arbitrary text into a valid JSON string literal
b, _ := json.Marshal(rawText)
escaped := string(b)
// Unescape a JSON-encoded string literal
var unescaped string
_ = json.Unmarshal([]byte(escaped), &unescaped)Auto mode parses your input first. If the input is a valid JSON object or array (like {"a": 1}), it is already unescaped so the tool escapes it into a JSON string literal. If the input is a JSON string literal (like "{\"a\":1}") or an unquoted log snippet containing \" escapes, it automatically unescapes and pretty-prints it.
Simply paste the raw log string—whether it has outer quotes or not—with "Unwrap multi-layer escapes" enabled. The tool iteratively decodes each layer (up to 6 layers) until it reaches clean, valid JSON and shows the exact layer count.
Disable outer quotes when you are pasting the escaped text directly inside an existing quoted string in a JSON file, cURL command, Java/Go source file, or Postman body so you do not end up with duplicate "" quotes.
Yes. Standard JSON unescaping automatically decodes \uXXXX sequences (including Chinese/Japanese characters and UTF-16 Emoji surrogate pairs) back into readable UTF-8 text.
RFC 8259 allows escaping "/" as "\/" even though it is optional. Web frameworks enable it when embedding JSON directly inside HTML <script> tags so a string containing "</script>" cannot prematurely close the script block.
Never. All detection, escaping, recursive unescaping, and file reading execute 100% locally inside your browser tab with zero network requests.