What does the JSON Unescaper do?
The JSON Unescaper removes backslash escape sequences (\", \/, \\, \n, \r, \t, \b, \f, and \uXXXX) from stringified JSON logs, API payloads, and double-escaped strings in real time. Executing 100% in-browser on blueutils.com, it strips enclosing quote wrappers, normalizes escape characters, and formats valid JSON structures into an indented hierarchy.
- Real-Time Zero-Latency Parsing: Processes input instantly as you type with live before-and-after byte size metrics (
X B → Y B). - Flexible Formatting Modes: Supports Formatted (2-space indentation), Minified (single-line compact), and Raw unescaped text modes.
- Line & Column Error Diagnostics: Validates unescaped JSON syntax automatically and highlights failing line numbers in red.
Core Concepts & Technical Specifications
- Escape Sequence Normalization:
\"→": Restores double quotes inside JSON keys and string values without breaking string boundaries.\/→/: Normalizes escaped forward slashes common in URLs and HTML script payloads.\\→\: Reconstructs literal backslashes used in regular expressions and file paths.\n,\r,\t: Converts escaped control markers back into true whitespace and line breaks.\uXXXX: Resolves 4-digit hexadecimal unicode escape markers into native UTF-8 glyphs.
- Double Escaping & Log Ingestion:
- Log aggregators (such as AWS CloudWatch, Datadog, and ELK stack) frequently double-escape JSON payloads into string fields.
- The unescaper strips outer quotes (
"{\"key\":\"val\"}"→{"key":"val"}) and cleans internal escape characters in a single pass.
- In-Browser Privacy:
- All string unescaping and formatting executes in local browser memory.
- No log traces, auth tokens, or sensitive API payloads are transmitted across networks.
How to use the tool?
- Input Escaped Payload:
- Paste escaped JSON or stringified log data into the left editor, click Upload to load a
.json/.logfile, or click Sample to load an escaped example.
- Paste escaped JSON or stringified log data into the left editor, click Upload to load a
- Choose Output Format:
- Select Formatted for readable 2-space indentation, Minified for compact JSON, or Raw for plain unescaped text.
- Copy or Download:
- Clean unescaped output appears instantly on the right. Click Copy or Download to save as
output.json(oroutput.txt).
- Clean unescaped output appears instantly on the right. Click Copy or Download to save as
Pipeline & Contextual Workflows
- Log Analysis Workflow: Paste stringified CloudWatch or Datadog log messages to restore clean, syntax-highlighted JSON structures for quick debugging.
- Complementary Serialization Pipeline: Convert formatted JSON objects back into single-line escaped strings for cURL with JSON Escaper.
- Format Conversion: Convert unescaped JSON structures to YAML configurations using JSON to YAML Converter.
REST API Integration
blueutils.com provides a free REST API endpoint (POST https://blueutils.com/api/json/unescaper) for automated log parsing, backend ETL jobs, and monitoring agents.
API Request Parameters
| Name | Type | Description | Example |
|---|---|---|---|
rawText / json |
String / Object | Escaped JSON string with backslashes or stringified object. | "{\\\"service\\\":\\\"blueutils.com\\\"}" |
format |
String | Optional. Output formatting style: formatted (default), minified, or raw. |
"formatted" |
allowPlainText |
Boolean | Optional. When true, returns unescaped plain text without JSON syntax validation. |
false |
API Request Payload Examples
cURL (Formatted JSON Output)
curl -X POST https://blueutils.com/api/json/unescaper \
-H "Content-Type: application/json" \
-d '{
"rawText": "{\\\"service\\\":\\\"blueutils.com\\\",\\\"active\\\":true}",
"format": "formatted"
}'cURL (Raw Plain Text Mode)
curl -X POST https://blueutils.com/api/json/unescaper \
-H "Content-Type: application/json" \
-d '{
"rawText": "Hello\\nWorld\\t\\\"Quotes\\\"",
"format": "raw"
}'Python
import requests
url = "https://blueutils.com/api/json/unescaper"
payload = {
"rawText": '{\\"service\\":\\"blueutils.com\\",\\"active\\":true}',
"format": "formatted"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())Java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String jsonPayload = """
{
"rawText": "{\\"service\\":\\"blueutils.com\\",\\"active\\":true}",
"format": "formatted"
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://blueutils.com/api/json/unescaper"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(jsonPayload))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}API Response Parameters
| Name | Type | Description | Example |
|---|---|---|---|
isValid |
Boolean | Indicates whether the unescaping operation succeeded. | true |
result |
String | Unescaped string output formatted according to format option. | "{\n \"service\": \"blueutils.com\"\n}" |
isJson |
Boolean | Indicates whether the unescaped output is valid JSON. | true |
data |
Object / Array | Parsed native object/array representation returned when input is valid JSON. | {"service":"blueutils.com"} |
originalSize |
Number | Byte length of original input payload. | 45 |
resultSize |
Number | Byte length of unescaped output result. | 35 |
error |
String | Detailed error message returned on invalid syntax. | "Invalid JSON syntax: Unexpected token '}' (Line 2)" |
API Response Payload Examples
Success Response (HTTP 200 OK)
{
"isValid": true,
"result": "{\n \"service\": \"blueutils.com\",\n \"active\": true\n}",
"isJson": true,
"data": {
"service": "blueutils.com",
"active": true
},
"originalSize": 52,
"resultSize": 46
}Validation Failure Response (HTTP 400 Bad Request)
{
"isValid": false,
"error": "Invalid JSON syntax: Unexpected token '}' at line 3 column 1. If unescaping non-JSON plain text, set format to 'raw'."
}Rate Limit Exceeded Response (HTTP 429 Too Many Requests)
{
"error": "API rate limit exceeded. Please wait or contact support@blueutils.com."
}Why use an API to unescape JSON?
Automating JSON unescaping provides major performance and reliability benefits:
- Automated Cloud Log Ingestion: Ingests stringified log messages from AWS CloudWatch or Kafka streams and unescapes nested structures for database indexing.
- LLM Context Minimization: Strips bloated escape sequences before sending data to AI models, saving input tokens and reducing parse errors.
- Deterministic Unicode & Control Character Restoration: Guarantees accurate restoration of unicode glyphs and multi-line formatting without regex errors.
Native Usage
Unescape stringified JSON strings locally across terminal tools and programming runtimes:
Browser DevTools Console
// Unescape stringified JSON in browser console
JSON.parse(escapedString);Linux / macOS (Bash & sed + jq)
# Unescape stringified JSON using sed and jq
sed 's/\\"/"/g; s/\\\\/\\/g' escaped.txt | jq .Windows (PowerShell)
# Unescape stringified JSON in PowerShell
[regex]::Unescape((Get-Content escaped.txt -Raw)) | ConvertFrom-Json | ConvertTo-Json -Depth 5Python
import json
escaped_text = r'{\"service\":\"blueutils.com\",\"active\":true}'
unescaped_json = json.loads(f'"{escaped_text}"')
parsed = json.loads(unescaped_json)
print(json.dumps(parsed, indent=2))Node.js
const escaped = '{\\"service\\":\\"blueutils.com\\",\\"active\\":true}';
const unescaped = escaped.replace(/\\"/g, '"').replace(/\\\\/g, '\\');
console.log(JSON.stringify(JSON.parse(unescaped), null, 2));Java (Jackson)
import com.fasterxml.jackson.databind.ObjectMapper;
public class Main {
public static void main(String[] args) throws Exception {
String escaped = "{\\\"service\\\":\\\"blueutils.com\\\",\\\"active\\\":true}";
String unescaped = escaped.replace("\\\"", "\"").replace("\\\\", "\\");
ObjectMapper mapper = new ObjectMapper();
Object json = mapper.readValue(unescaped, Object.class);
System.out.println(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(json));
}
}