How to use the json unescape
- Paste your escaped JSON string into the text area. You can include or omit the surrounding double quotes.
- The tool automatically decodes every escape sequence as you type or paste.
- Copy the unescaped plain text from the result box below.
- If the input contains an invalid escape like
\x, a clear error message explains what went wrong.
How JSON unescape works
A JSON string literal uses the backslash character to encode special characters that cannot appear directly in the source text. When you json unescape a value, each two-character sequence starting with a backslash is replaced by the single character it represents.
The standard escape sequences defined by the JSON specification (RFC 8259) are:
\"becomes a double quote\\becomes a single backslash\/becomes a forward slash\bbecomes a backspace\fbecomes a form feed\nbecomes a line feed (newline)\rbecomes a carriage return\tbecomes a horizontal tab\uXXXXbecomes the Unicode character at the given hexadecimal code point
This tool wraps your input in double quotes if they are missing, then delegates to the native JSON.parse function. That guarantees full compliance with the specification, including correct handling of surrogate pairs for characters outside the Basic Multilingual Plane.
Surrogate pairs and Unicode
Characters above U+FFFF, such as most emoji, are encoded in JSON as two consecutive \uXXXX sequences called a surrogate pair. For example, the grinning face emoji is written as \uD83D\uDE00. The first value (D83D) is the high surrogate and the second (DE00) is the low surrogate.
When you unescape json strings containing these pairs, the parser combines them into a single character. A lone surrogate without its partner is technically invalid according to the JSON specification, and JSON.parse will reject it with an error. This strict behaviour prevents malformed data from passing through silently.
If you need to convert decoded JSON data into other formats, tools like json to xml or json formatter handle the resulting Unicode text correctly.
Common mistakes when decoding JSON strings
Several pitfalls cause errors during a json unescape operation:
- Missing closing quote. If your input starts with a double quote but does not end with one, the parser treats it as an unterminated string and throws an error.
- Invalid escape characters. Sequences like
\xor\ado not exist in JSON. Only the nine sequences listed above are valid. - Incomplete hex codes. A
\umust be followed by exactly four hexadecimal digits. Writing\u41instead of\u0041will fail. - Double escaping. If a string was escaped twice during transport, running the unescape operation once will leave residual backslashes. You may need to run it again on the output.
The error messages produced by this tool point out exactly which rule was broken so you can fix the source data quickly.
Practical use cases
Developers frequently encounter escaped JSON strings in log files, API responses, database records and configuration files. A common scenario is reading a JSON payload that has been serialised inside another JSON string, resulting in nested escapes like "{\"name\":\"Ada\"}". Decoding the outer layer reveals the inner JSON object.
Another frequent case involves debugging raw HTTP traffic where newline characters appear as \n rather than actual line breaks. Pasting that traffic through a json unescape tool restores readable formatting instantly.
For structured data conversion after decoding, you might pass the clean JSON through json to html table or json to markdown table to generate documentation or reports.
Reference table of JSON escape sequences
The following table lists every valid escape sequence recognised during a json unescape operation, along with its Unicode code point and description.
| Escape | Code Point | Description |
|---|---|---|
\" | U+0022 | Double quotation mark |
\\ | U+005C | Reverse solidus (backslash) |
\/ | U+002F | Solidus (forward slash) |
\b | U+0008 | Backspace |
\f | U+000C | Form feed |
\n | U+000A | Line feed (newline) |
\r | U+000D | Carriage return |
\t | U+0009 | Horizontal tab |
\uXXXX | U+XXXX | Unicode character at hex value XXXX |
The forward slash escape (\/) is optional in JSON. It exists so that the string </script> can be safely embedded inside HTML script tags without prematurely closing the block.
Worked examples
| Example | Input | Result |
|---|---|---|
| Newlines and tabs | Escaped JSON string: "Line 1\nLine 2\tTabbed" | Line 1 / Line 2 Tabbed |
| Unicode emoji surrogate pair | Escaped JSON string: "\uD83D\uDE00" | 😀 |
| Without surrounding quotes | Escaped JSON string: Hello\nWorld | Hello / World |
| Nested JSON object | Escaped JSON string: "{\"key\":\"value\"}" | {"key":"value"} |
FAQ
Do I need to include the double quotes around my string?
No. If you omit the surrounding double quotes, the tool adds them automatically before parsing. If you include them, they are used as-is.
What happens if the input contains an invalid escape like \x?
The tool displays a clear error message indicating that the escape sequence is not valid JSON. Only the nine standard escape sequences are accepted.
Can this tool decode Unicode surrogate pairs?
Yes. Sequences like \uD83D\uDE00 are combined into the correct single Unicode character, such as an emoji, using the standard JSON parsing rules.
Is my data sent to a server when I use this tool?
No. The json unescape operation runs entirely in your browser using JavaScript. Nothing is uploaded or transmitted over the network.
Why does my string still have backslashes after decoding?
The original data may have been double-escaped. Try pasting the output back into the tool to remove a second layer of escaping.
Does this work for entire JSON objects or only strings?
This tool is designed for individual JSON string literals. If you paste a full JSON object, wrap it in quotes so it is treated as a string, or use a dedicated JSON formatter instead.