String Escape
Escape and unescape strings in various formats
String Escape & Unescape: Escape Strings for JSON, HTML & JavaScript Online
Special characters are converted into safe sequences for any context — JSON, HTML, JavaScript, XML, URL, or CSV — by this string escape tool. A quote inside a JSON string becomes \", an ampersand in HTML becomes &, a backslash in regex needs doubling. Text is pasted, the format is selected, and properly escaped or unescaped output is produced instantly. Unescaping is also supported for all formats.
Supported formats
Escaping is supported for JSON (\n, \", \\), HTML entities (<, &, '), JavaScript/TypeScript strings, URL percent-encoding, XML entities, and CSV quoting. Unescaping in all these formats is also available to convert escaped text back to readable form.
Why does escaping matter?
Improper escaping is one of the most common sources of bugs and security vulnerabilities. Unescaped HTML leads to XSS attacks. Unescaped SQL leads to injection. Unescaped JSON causes parse failures. Getting escaping right is a small step that prevents major headaches.