JSON Unescape
Unescape a JSON string back to readable text in your browser. Decodes \n, \t, \", \\, and \uXXXX, with or without surrounding quotes. 100% private, no upload.
Options
What is JSON Unescaping?
JSON unescaping is the reverse of JSON escaping: it takes a string full of escape sequences — \n, \t, \", \\, \uXXXX — and turns each one back into the character it represents, recovering the original text. Where escaping makes a string safe to store inside a JSON document, unescaping makes a stored string readable again.
The need shows up constantly in debugging and data work. You copy a field out of a structured log and it is full of \n and \" that hide the real message — unescaping reveals the actual multi-line text. An API stored a request body as a string (JSON-in-JSON), and you need to read the inner object — unescaping turns {\"a\":1} back into {"a":1}. A legacy system emitted ASCII-safe output where every accent became \uXXXX — unescaping restores café and résumé. In each case the data is technically intact but unreadable until decoded.
This tool is built for that decode path with three advantages. First, it is lenient about the surrounding quotes: paste a full literal or just the escaped body, and it does the right thing — because escaped strings are usually copied out of context. Second, it decodes \uXXXX correctly, combining surrogate pairs into proper astral characters like emoji, identical to a compliant JSON parser, so anything escaped by a serializer round-trips perfectly. Third, it runs 100% in your browser, so the log fields and payloads you decode — which often contain PII or secrets — never reach a server. To re-escape afterward, use our JSON Escape tool; to validate the decoded JSON, see the JSON Formatter.
// Escaped input (copied from a log, quotes optional)
User said: \"it works!\"\nSession ended.
// Unescaped output — readable again
User said: "it works!"
Session ended.
// \uXXXX and surrogate pairs decode too
caf\u00e9 \ud83d\ude00 -> café 😀
// JSON-in-JSON
{\"a\":1} -> {"a":1} Key Features
Full JSON Escape Decoding
Decodes the complete set of JSON escapes — \n \r \t \b \f \" \\ \/ and \uXXXX — back to their real characters, identical to a compliant JSON parser. Anything a serializer escaped comes back byte for byte.
Quotes Optional
Paste a complete string literal with surrounding quotes, or just the escaped body without them — the tool detects which and decodes correctly. Ideal for strings copied out of the middle of a log or document.
Correct Unicode & Emoji
\uXXXX escapes decode to their Unicode characters, and consecutive surrogate escapes combine into the right astral character — \ud83d\ude00 becomes 😀, \u00e9 becomes é. No mangled code points.
Clear Error Reporting
Malformed input — a lone backslash before an unrecognized character, or an unbalanced quote — surfaces an explicit error banner instead of silently producing garbage, so you know exactly what to fix.
Swap for Round-Trip Verification
One Swap direction button flips into escape mode in place and re-encodes the decoded text, letting you confirm unescape → escape returns the original string before you trust the result.
100% Browser-Based Privacy
All decoding runs client-side — the log fields and payloads you unescape (often containing PII or secrets) never leave the browser. Verify it in the Network tab: zero requests on paste.
Examples
Escaped string copied from a log
"User said: \"it works!\"\nSession ended."
A JSON-escaped log field with \" and \n. Unescape it to read the real two-line message with actual quotes — exactly what was logged.
Read a JSON-in-JSON payload
{\"event\":\"signup\",\"user\":{\"id\":42}} An inner JSON object stored as an escaped string. Unescaping reveals the real JSON so you can read or re-parse it. No surrounding quotes needed — they are added automatically.
Decode \uXXXX Unicode escapes
caf\u00e9 \ud83d\ude00 r\u00e9sum\u00e9
ASCII-safe escapes from a legacy system. Unescape turns \u00e9 back into é and the surrogate pair \ud83d\ude00 back into 😀.
Restore a multi-line snippet
function greet(name) {\n return \"Hi \" + name;\n} A code snippet that was flattened into a single JSON string. Unescaping restores the real newlines so it is readable and runnable again.
How to Use
- 1
Paste the escaped string
Enter or paste a JSON-escaped string — with or without its surrounding double quotes. The decoded text appears instantly. Click 'Load example' to try a sample like an escaped log line or a \uXXXX-encoded string.
- 2
Read the decoded output
Escape sequences become real characters: \n turns into line breaks, \" into quotes, and \uXXXX into Unicode. If the input is malformed, an error banner explains the problem so you can fix the offending backslash.
- 3
Copy or verify the result
Click Copy to grab the readable text, or send it to the JSON Formatter to validate. Click Swap direction to re-escape it in place and confirm the round-trip matches your original.
Common Decoding Pitfalls
Invalid Escape Like \q or \x41
JSON only recognizes \n \r \t \b \f \" \\ \/ and \uXXXX. A backslash before anything else — \q, or a C-style \x41 — is not a valid escape and decoding fails. Replace \x41 with \u0041, and remove stray backslashes that were meant to be literal (a literal backslash must be written \\).
value: \q and \x41 // \q and \x hex are not valid JSON escapes -> error
value: \\q and \u0041 // literal backslash doubled; hex written as \u -> decodes
Unbalanced Quotes in Unescaped Input
When you paste a bare body (no outer quotes), the tool wraps it in quotes before decoding. If the body itself contains an unescaped double quote, the wrapping breaks and decoding fails. Escape interior quotes as \" or paste the fully-quoted literal instead.
say "hi" there // interior unescaped " breaks auto-wrapping -> error
say \"hi\" there // interior quotes escaped -> decodes to: say "hi" there
Expecting a Literal Backslash That Was Not Doubled
A single backslash in the input is interpreted as the start of an escape. If you actually wanted a literal backslash (e.g. a Windows path), it must appear doubled as \\. A lone \ before a normal letter triggers an invalid-escape error.
path: C:\Users\Alice // \U and \A are invalid escapes -> error
path: C:\\Users\\Alice // doubled backslashes -> decodes to C:\Users\Alice
Common Use Cases
- Decode Structured Log Fields
- Copy a message field full of \n and \" out of a JSON log line and unescape it to read the real multi-line message exactly as it was emitted, instead of squinting at escape sequences.
- Read JSON-in-JSON Payloads
- Turn an inner JSON object that was stored as an escaped string field back into real JSON, so you can read it or paste it into a parser — common in webhook envelopes and audit logs.
- Restore Unicode from ASCII-Safe Output
- Decode \uXXXX-heavy output from a legacy system back into accented letters, CJK characters, and emoji, recovering the human-readable form of data that was forced to pure ASCII.
- Un-flatten Code Snippets
- Convert a script or query that was collapsed into a single JSON string (every newline as \n) back into properly formatted, multi-line, readable code.
- Debug Double-Encoded Data
- When a value looks like \\n or \\\", unescape once to inspect whether it was accidentally escaped twice upstream, then fix the producer — a frequent integration bug.
- Inspect API Error Messages
- Many APIs return error details as escaped strings inside a JSON envelope. Unescape the message to read stack traces and nested payloads that are otherwise hidden behind escape sequences.
Technical Details
- Decoding Algorithm
- The tool parses the input as a JSON string: if it is already wrapped in double quotes it is decoded as-is, otherwise the raw input is wrapped in quotes first so a bare escaped body still decodes. Each recognized escape (\n \r \t \b \f \" \\ \/ \uXXXX) maps to its character; this mirrors a compliant JSON parser, guaranteeing that any serializer-escaped string returns to its exact original.
- Surrogate Pair Reconstruction
- A \uXXXX escape yields a single UTF-16 code unit. When a high surrogate (\uD800–\uDBFF) is immediately followed by a low surrogate (\uDC00–\uDFFF), the two are combined into one code point above the Basic Multilingual Plane — so \ud83d\ude00 decodes to the single character 😀 rather than two broken halves.
- Validation and Error Handling
- If the input contains an invalid escape (a backslash followed by an unrecognized character, or a malformed \u sequence) or unbalanced quotes that break wrapping, decoding fails cleanly and an error banner is shown rather than emitting corrupted output. Valid input always produces the exact decoded string; invalid input never produces a misleading partial result.
Best Practices
- Paste With or Without Quotes — Both Work
- Do not waste time trimming surrounding quotes. The tool decodes "hello\nworld" and hello\nworld identically, so paste whatever you copied — including a fragment lifted from the middle of a larger document — and read the result.
- Unescape Once, Then Check for Double-Encoding
- If the decoded output still shows backslash sequences like \n, the original was double-escaped upstream. Unescape a second time to confirm, then fix the producer so it escapes only once rather than relying on repeated decoding.
- Validate the Decoded JSON
- After unescaping a JSON-in-JSON payload, run the result through our JSON Formatter to confirm it is valid and to pretty-print it. Unescaping recovers the text; the formatter confirms the structure.
- Verify Round-Trips with Swap
- Click Swap direction to re-escape the decoded text and check it matches the string you started with. A mismatch points to a malformed input or an unexpected escape, surfacing data problems before they propagate.
Frequently Asked Questions
What does this JSON unescape tool do?
Do I need to include the surrounding double quotes?
Is my data uploaded anywhere?
Why do I get an 'invalid escape sequence' error?
How do I read a JSON object that was stored as a string (JSON-in-JSON)?
Does it correctly decode \uXXXX and emoji?
Related Tools
View all tools →Base64 Decoder & Encoder
Encoding & Formatting
Decode and encode Base64 online for free. Real-time conversion with full UTF-8 and emoji support. 100% private — runs in your browser. No signup needed.
Base64 to Image Converter
Encoding & Formatting
Decode a Base64 string or data URI back into an image in your browser. Preview, read dimensions & MIME, then download as PNG, JPG, GIF, SVG. No upload.
CSV to JSON Converter
Encoding & Formatting
Convert CSV to JSON in your browser. RFC 4180, type inference, header row, big-int safe. 100% private, no upload.
HTML to Markdown Converter
Encoding & Formatting
Convert HTML to clean Markdown in your browser — GFM tables, task lists, and links. Choose ATX/Setext headings and inline or reference links. Great for migrating web content or feeding LLMs. 100% private, no upload.
Image to Base64 Converter
Encoding & Formatting
Convert images to Base64 data URIs in your browser — PNG, JPG, GIF, WebP, SVG, ICO. Copy HTML, CSS, Markdown & JSON, with the exact size increase. 100% private, no upload.
JSON Diff & Compare
Encoding & Formatting
Compare two JSON files instantly in your browser. Side-by-side highlighting, RFC 6902 JSON Patch output, ignore noisy fields like timestamps and IDs. 100% private, no upload.