JSON String Unescaper
Decode an escaped JSON string back into readable text with real line breaks.
Was this tool helpful?
Thanks for the feedback!
The JSON String Unescaper takes a string full of escape sequences such as \n, \t and \" and shows the text they represent, with real line breaks, tabs and quotes. It is built for reading values pulled out of logs, API responses and config files, where multi-line text has been squeezed onto one line.
Examples
Input "Line one\nShe said \"hi\"" gives:
Line one
She said "hi"
A value from a JSON log, "Error at line 3:\n\tat com.shop.Cart.add(Cart.java:42)", turns back into a readable two-line stack trace with its tab indent. Unicode escapes are converted too, so ₹500 becomes ₹500, and an escaped slash \/api becomes /api.
Supported escape sequences
| Escape | Becomes |
|---|---|
\n, \r | line feed, carriage return |
\t | tab |
\", \\, \/ | " and \ and / |
\b, \f | backspace, form feed |
\uXXXX | the Unicode character with that hex code |
These are the only escapes JSON allows. Sequences borrowed from other languages, such as \x41 or \a, make the input invalid and produce an error.
With or without the outer quotes
The tool first tries to read your input as a complete JSON string, quotes included. If that fails, it adds the quotes itself and tries again, so you can paste just the inside of the value. Spaces and line breaks around the input are trimmed first. One case still needs the quotes: text that ends with an escaped quote, like She said \"hi\", because the final " looks like a closing quote. Wrap it in quotes and it decodes correctly.
When you get an error
- You pasted a whole object.
{"a":1}is JSON, but not a string. Copy only the string value you want to read. - The text contains a bare quote.
She said "hi"without backslashes is not an escaped string; it is already plain text. - An invalid escape such as
\xor a single backslash before an ordinary letter is present. In a Windows path, each backslash must be doubled.
Text that was escaped twice
If the result still shows \n as two visible characters, the value was escaped twice, which happens when JSON is stored inside another JSON string. For example "a\\nb" decodes to a\nb, not to two lines. Paste the output back in and unescape it again. The work happens in your browser, so log lines with internal details stay on your machine. To go the other way, use the JSON String Escaper; to read a whole document rather than one value, use the JSON Formatter.