Text Escape
& Unescape Online
text-escape
Input
Text EscapeJSON
Ctrl+↵ escapeCtrl+⇧+D unescape
Was this tool helpful?
Related Tools
Frequently Asked Questions
Escaping replaces special characters with safe sequences that do not break the format's syntax. For example, a quote inside a JSON string without escaping would prematurely end the string, but when escaped it becomes part of the content.
Escaping is necessary when inserting user input into JSON, XML, HTML, or URLs. Without it, special characters can break the document structure, cause parsing errors, or create security vulnerabilities.
In JSON, you escape quotes (\"), backslash (\\), newline (\n), tab (\t), and carriage return (\r). In XML, five characters are escaped: < (<), > (>), & (&), " ("), and ' (').
JSON uses backslash sequences for escaping (\n, \", \\), while XML replaces characters with entities (<, &, "). These are different formats with different rules, so choosing the correct escaping mode matters.