Copying multi-line SQL queries, JSON payloads, HTML snippets, or shell commands directly into source code almost always breaks syntax because of unescaped quotes, backslashes, tabs, and line breaks. This String Escaper converts raw text into safely escaped literals (and unescapes existing literals back into readable text) locally in your browser.
JSON.stringify() rules - escapes double quotes (\"), backslashes (\\), newlines (\n), carriage returns (\r), tabs (\t), and control characters. Ideal for pasting raw text inside a JSON property value.'\''. In POSIX shells, single-quoted strings preserve every character literally (including $VARS, backticks, and backslashes), making this the safest way to pass arbitrary text in shell scripts.\n, \t, \", and \uXXXX sequences back into real characters.\n and \" sequences, choose Unescape, and the tool restores real line breaks and quotes so you can read stack traces or SQL statements clearly.'\'' used in Bash escaping? Inside single quotes in Bash, nothing - not even a backslash - can escape another single quote. Therefore, closing the single quote ('), adding an escaped quote (\'), and reopening single quotes (') safely concatenates a literal apostrophe.\uXXXX escapes in JSON unescape cleanly back to Unicode characters.