String Escape/Unescape
Output
Escape special characters so a string can be safely embedded in JSON, JavaScript source code, or a SQL statement — or unescape one back to its original form. Select the target format and direction, and the conversion updates live.
Frequently asked questions
Why do JSON and JavaScript share the same escaping here?
JSON string syntax is a subset of JavaScript string syntax for the common escape sequences (\n, \t, \", \\, etc.), so the same escaping produces a valid literal in both contexts when using double quotes.
How does SQL escaping work?
It doubles single quotes (' becomes ''), which is the ANSI SQL standard way to include a literal quote inside a string literal. Some databases also support backslash escaping, which isn't covered here.