String Escape Tool
Escape and unescape a string for JSON, JavaScript, URL, or SQL, covering backslashes, quotes, control characters, and all percent escapes. Both directions.
How to use
- Type the string, or paste an escaped value to reverse it.
- Choose the format and whether to escape or unescape.
- Copy the result.
The string escape tool escapes a value for a target format and reverses it again. The same string needs different escapes in JSON, JavaScript, a URL, and a SQL literal, which is why the format is a choice here.
Paste or type something above.
Questions about string escape tool
- When should I use SQL escaping?
- For a literal inside a query string, a single quote is doubled. For anything user-supplied, use a parameterised query instead.
- Does JSON escaping keep non-ASCII characters?
- Yes. Only the backslash, the double quote, and control characters are escaped, so accented text and emoji stay readable.
- What if my unescape fails?
- JSON unescaping reports the exact problem, because a malformed escape is a real bug in the data rather than something to paper over.
Related tools
- JSON Formatter Format minified or badly indented JSON into clean, readable output with your choice of ind...
- URL Encoder Percent-encode characters that are unsafe in a URL, with component or whole-URL rules, opt...
- HTML Entity Encoder Escape ampersands, angle brackets, and quotes into HTML entities, or encode every printabl...