About JSON String Unescaper
Logs, API responses and config files often hold text that was escaped to fit inside JSON: a stack trace full of \n, a message with \" around every quotation, accented names written as \u00e9. Paste the literal here, with or without its surrounding quotes, and read it the way it was meant to be read.
If the literal is broken, for example by a stray quote or a backslash JSON does not recognise, you are told the line and column of the problem instead of getting half a result.
How it works
- Escaping uses the browser’s own JSON writer, so the result is exactly what JSON.stringify would produce: \" for quotes, \\ for backslashes, \n and \t for line breaks and tabs, \u0001 style escapes for other control characters.
- With non-ASCII escaping on, every character above U+007E is written as \u followed by four hexadecimal digits; characters outside the Basic Multilingual Plane, such as emoji, become two of them.
- In the other direction the literal is checked character by character first, so a mistake is reported with its line and column, then decoded.
Questions
Do I need to include the surrounding double quotes?
No. If the text starts and ends with a double quote, they are treated as the ends of the literal; otherwise the whole input is read as the inside of a string. Line breaks at either end are ignored.
Why is my Windows path rejected?
In JSON a backslash starts an escape, so C:\Users is not valid: \U is not an escape JSON knows. A real backslash is written \\. The error names the column of the first such backslash.
What about text that was escaped twice?
Unescape it once, paste the result back into the input, and it is unescaped again. Each pass removes one layer of escaping.
Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.