Reading escaped JSON strings from logs and APIs
Structured logs, error trackers and APIs often hand you text inside a JSON string. A three-line error message comes out as one long line with \n where the breaks should be. An HTML snippet arrives with \" around every attribute. A name such as José appears as Jos\u00e9. All of this is correct JSON: inside a string, a line break, a double quote and a backslash have to be escaped, and any character may be written as \u with its four-digit hex code. It is correct, but hard for a person to read.
Unescaping reverses it. The tool walks through the text and replaces each escape with the character it stands for: \n with a line break, \t with a tab, \" with a quote, \\ with a single backslash, \/ with a slash, and \u00e9 with é. The rare \b and \f become backspace and form feed. Text without a backslash is copied as it is, so a long log message comes back exactly as it was before it was escaped.
You can paste the string with or without its outer quotes. When the pasted text, ignoring spaces at the ends, starts and ends with a double quote, the tool treats those two as the string's own delimiters and drops them. A quote anywhere else is kept, because text copied out of a log often has bare quotes in it that are part of the message.
Emoji and other characters beyond the first 65,536 are written in JSON as two \u escapes, a surrogate pair such as \ud83d\ude00. The tool turns each escape into its UTF-16 code unit and the pair joins back into one emoji, just as a JSON parser does. If a string was escaped twice, which happens when JSON is stored inside another JSON string, the first pass leaves \n and \" behind. Run the result through again to reach the plain text.
Some escapes are not JSON at all. \x41 comes from JavaScript and Python, \a and \e come from C and shells, and \' is how many languages escape a single quote. A strict JSON reader rejects them, and so does this tool: it stops at the first one and says which line and column it is on and which escapes JSON allows. Everything runs in your browser, so private log lines and payloads stay on your machine.