1x and 2x Unescaping
Convert escaped string sequences back into normal JSON, with support for recursive double-unescaping of nested payloads.
json unescape, double unescape json, decode escaped json
Unescape JSON strings back into readable, formatted JSON for debugging payloads and logs.
Unescape JSON strings online. Instantly decode quotes, backslashes, tabs, and unicode escape flags from database dumps, Kubernetes variables, server configurations, and API log payloads locally in your browser.
Convert escaped string sequences back into normal JSON, with support for recursive double-unescaping of nested payloads.
json unescape, double unescape json, decode escaped json
Automatically format and beautify the recovered JSON string into a structured, readable layout.
format unescaped json, pretty print unescaped json
Decodes unicode strings, clean escape flags, and formats logs locally in your browser without network calls.
local json unescaper, offline json string decoder
What is JSON Unescape?
When logging network transactions or serializing structures inside database tables, systems represent JSON payloads as safe string literals. This is done by adding escape sequences (like replacing " with \").
JSON Unescaping reverses this process. It removes the backslashes that escape quotes, processes escaped control characters like tabs (\t) and newlines (\n), and recovers the original, clean JSON structure that you can inspect and debug.
Why Unescaping JSON is Important
Developers and QA engineers frequently inspect logs from Elasticsearch, Datadog, Kibana, or CloudWatch, which display JSON payloads as escaped string snippets. Trying to parse or format these logs directly in a JSON viewer will fail due to validation errors. Unescaping first is a necessary step to recover a parseable JSON structure.
Similarly, double-escaped variables inside Kubernetes YAML, Terraform configurations, or shell scripts need to be unescaped 2x to examine the underlying JSON schema. Our tool provides a simple recursive unescape toggle to resolve both single and double-escaped payloads instantly.
Reference Table
| Sequence | Unescapes to | Character Name |
|---|---|---|
| \" | " | Double Quote |
| \\ | \ | Backslash |
| \/ | / | Forward Slash |
| \n | Newline | Line Feed |
| \r | Carriage Return | Carriage Return |
| \t | Tab | Horizontal Tab |
| \b | Backspace | Backspace |
| \f | Form Feed | Form Feed |
Examples
{\n \"user\": \"developer\",\n \"comment\": \"Line one\\nLine two\",\n \"quote\": \"JSON is \\\"awesome\\\"\"\n}{
"user": "developer",
"comment": "Line one\nLine two",
"quote": "JSON is \"awesome\""
}{
"user": "developer",
"comment": "Line one
Line two",
"quote": "JSON is \"awesome\""
}Language Code
// Unescape JSON using JSON.parse
const escaped = '{\\"msg\\":\\"Hello World\\"}';
const unescaped_1x = JSON.parse('"' + escaped + '"');
console.log(unescaped_1x); // returns {"msg":"Hello World"}
const parsedObj = JSON.parse(unescaped_1x);# Unescape JSON using json.loads
import json
escaped = '{\\"msg\\": \\"Hello World\\"}'
# Using raw codecs or json parsing
unescaped = json.loads(f'"{escaped}"')
print(unescaped) # returns {"msg": "Hello World"}// Unescape JSON in Go
package main
import (
"encoding/json"
"fmt"
)
func main() {
escaped := `{\"msg\":\"Hello\"}`
var unescaped string
// Marshal wraps and Unmarshal decodes escaped sequences
json.Unmarshal([]byte(`"`+escaped+`"`), &unescaped)
fmt.Println(unescaped) // returns {"msg":"Hello"}
}<?php
// Unescape JSON using stripcslashes or json_decode
$escaped = '{\"msg\":\"Hello\"}';
$unescaped = stripcslashes($escaped);
echo $unescaped; // returns {"msg":"Hello"}
?>Comparisons
JSON Unescaping replaces text escape characters like \" and \\ with raw symbols. JSON Decoding translates the unescaped characters into functional programming variables, dictionaries, or structs.
What are common mistakes?
Best practices
Workflow
Insert your raw escaped JSON string inside the input editor.
Check whether you need 1x or 2x unescaping for double-escaped structures.
Click the unescape button to run the browser-side unescape code.
Pretty print the output to easily read, inspect, and copy values.
Get answers to common questions about JSON unescaping, double unescaping, formatting, and best practices.
Learn how to prettify, format, and beautify JSON in Node.js using JSON.stringify, fs module, Express middleware, third-party libraries, and online tools. Includes real code examples.
Learn how to validate JSON data using online tools, JavaScript, Python, and schema validators. Includes common JSON errors, JSON Schema basics, and best practices for developers.
Advanced JSON examples including Schema.org FAQ JSON-LD, API error responses, DynamoDB items, and MongoDB documents. Ideal for testing JSON Viewer and Formatter tools.
Explore enterprise-grade JSON examples including OpenAPI schemas, webhook payloads, Kubernetes and Docker configs, and cloud log monitoring samples for JSON Viewer testing.
Explore a big JSON sample with multiple lists, nested objects, and real-world data points. Perfect for testing JSON Viewer, JSON Formatter, and large API responses.
Explore real-world JSON samples including payment APIs, books data, database records, AWS EC2, and Azure VM examples. Perfect for testing JSON Viewer and JSON Formatter tools.
Explore more free developer tools to speed up debugging, testing, and development.