{}JSONLint.app

Paste your escaped JSON string below to convert it back to readable JSON:

Mode:
Convert escaped JSON string back to JSON

What is JSON Escaping?

When JSON is embedded inside a string (like in a database field or API response), special characters must be escaped with backslashes. This tool converts those escaped strings back to readable, valid JSON.

Example

Escaped JSON string:

"{\\"name\\":\\"John\\",\\"age\\":30}"

Unescaped JSON:

{
  "name": "John",
  "age": 30
}

Common Escape Sequences

EscapedUnescapedDescription
\\""Double quote
\\\\\\Backslash
\\nnewlineLine feed
\\rreturnCarriage return
\\ttabHorizontal tab
\\uXXXXunicodeUnicode character

Why Does This Happen?

JSON gets double-escaped in several common scenarios:

  • Database storage — JSON stored as a text column needs escaping
  • API responses — JSON embedded in another JSON string
  • Logging — Log systems often escape JSON for single-line output
  • Message queues — Kafka, RabbitMQ often stringify JSON payloads
  • Environment variables — Complex config stored as escaped strings

Programmatic Solutions

JavaScript

// Unescape a JSON string
const escaped = '{"name":"John","age":30}';
const unescaped = JSON.parse(escaped);

// If double-escaped (string within string)
const doubleEscaped = '"{\"name\":\"John\"}"';
const parsed = JSON.parse(JSON.parse(doubleEscaped));

Python

import json

# Unescape a JSON string
escaped = r'{"name":"John","age":30}'
unescaped = json.loads(escaped)

# If double-escaped
double_escaped = r'"{"name":"John"}"'
parsed = json.loads(json.loads(double_escaped))

Command Line (with jq)

# Parse escaped JSON
echo '"{\"name\":\"John\"}"' | jq -r '.' | jq '.'

Escape Mode

This tool also works in reverse. Use Escape mode to convert JSON into an escaped string for embedding in:

  • JavaScript string literals
  • JSON string values
  • Database text fields
  • Environment variables

Pro Tips

  • 💡 Multiple layers — If one unescape doesn't work, the JSON might be double or triple escaped. Run it multiple times.
  • 💡 Check the quotes — Properly escaped JSON strings are usually wrapped in outer quotes.
  • 💡 Validate after — Use the JSON Validator to ensure the unescaped result is valid JSON.

Related Tools

Common Mistakes & Pro Tips

  • Unescaping reverses escape sequences back to raw charactersIt turns \n back into a real newline, \" back into a quote, and \\ back into a single backslash, recovering the original text that was placed inside a JSON string. It is the exact inverse of escaping a string's content.
  • Invalid escape sequences cause failureJSON only permits the escapes \" \\ \/ \b \f \n \r \t and \uXXXX. A stray backslash before any other character, such as \x or \q, is invalid and a strict unescaper will reject it rather than guess your intent.
  • Watch the layer count to avoid over- or under-unescapingIf a payload was escaped twice, one unescape pass leaves a layer of backslashes behind; unescape exactly as many times as it was escaped. Over-unescaping a single-escaped string can corrupt legitimate backslashes that were meant to remain.
  • \uXXXX requires four hex digitsA unicode escape must be a backslash, a lowercase u, and exactly four hexadecimal digits, like \u0041 for 'A'. Fewer digits or non-hex characters make the sequence invalid, and surrogate pairs (😀) must appear together to form characters above U+FFFF.
  • Unescaping content is not parsing the documentUnescaping operates on the characters inside one string; it does not interpret JSON structure like braces or arrays. If you have a full stringified JSON document, parse it (or stringify-then-parse) rather than only unescaping, or you may get text that is still a JSON literal.

Frequently Asked Questions

What does unescaping a JSON string do?

It converts the escape sequences inside a JSON string back into the literal characters they represent, so \n becomes an actual line break and \" becomes a plain quote. The result is the original raw text that was escaped to make it JSON-safe.

Why does unescaping fail on my input?

The most common cause is an invalid escape sequence, meaning a backslash followed by a character that JSON does not allow as an escape, such as \x, \q, or an incomplete \u that lacks four hex digits. JSON only recognizes a fixed set of escapes, so anything outside that set is an error.

Why do I still see backslashes after unescaping?

Your text was probably escaped more than once, so a single pass only removed the outermost layer. Run unescape again, once per layer of original escaping, until the backslashes that were truly part of the data are all that remain.

How do I turn \u-encoded characters back into readable text?

Unescape will convert each valid \uXXXX sequence into its Unicode character, so \u00e9 becomes e with an acute accent. Characters above U+FFFF are encoded as a surrogate pair of two \u escapes that must both be present and in order to decode correctly.

Is unescape the same as parsing JSON?

No. Unescape only processes the characters within a string value, while parsing interprets the whole document structure into objects, arrays, numbers, and so on. If you have an entire JSON value that was stringified, you typically want to parse it rather than only unescape the text.

Does my data stay private during unescaping?

Yes. The operation runs entirely in your browser with no network request, so the escaped string you paste is decoded locally on your device. Sensitive payloads never leave your machine.