DevToolStation

Encode & Decode

String Escape / Unescape

Escape and unescape strings for JSON, JavaScript, CSV, SQL, regex, shell and XML.

Loading the String Escape / Unescape…

About the String Escape / Unescape

Escape text so it can be pasted safely into a JSON string, JavaScript literal, CSV field, SQL literal, regular expression, shell command or XML, or reverse it. Each format follows that language’s own rules, such as doubled quotes in CSV and SQL and \uXXXX escapes in JSON.

How to use it

  1. Choose the target format.
  2. Choose Escape or Unescape.
  3. Paste the text and copy the result.

Frequently asked questions

Should I escape SQL by hand?
Only for one-off queries. In application code, use parameterised queries instead of building SQL strings.
How do I put a single quote in a shell argument?
Wrap the argument in single quotes and write each ' as '\''. The Shell format does this for you.
Is my text uploaded?
No. Everything runs in your browser tab with JavaScript. Nothing you enter is uploaded, logged or stored, and the page works offline once loaded.