Skip to content
en es

String Escape & Unescape

Make text safe to paste between quotes in code, a SQL query, a CSV file or a regex, or undo the escaping.

Runs in your browser — nothing is uploaded.

Copied

How to use it

  1. Pick Escape or Unescape and the target format.
  2. Paste the text. When escaping, the result is the text to put between the quotes (CSV adds its own quotes only when needed).
  3. To undo, paste the escaped text without its surrounding quotes and choose Unescape.

Frequently asked questions

Is my text uploaded?

No. Everything runs in your browser.

Does it add the surrounding quotes?

No: you get the content to place between your own quotes. The one exception is CSV, where a field containing a comma, quote or line break must be wrapped in double quotes.

What is the difference between SQL and MySQL?

Standard SQL only doubles single quotes (''). MySQL also accepts backslash escapes such as \', \n and \\. Prefer prepared statements over escaping by hand.

Is escaping enough to prevent SQL injection or XSS?

No. Use parameterised queries for SQL and context-aware output escaping for HTML. This tool is for quoting literals, not for security.

What does Unescape do with unknown sequences?

JSON and JavaScript escapes that are malformed (such as \x4 or a raw line break in JSON) report an error; PHP double-quoted strings keep unknown sequences as typed, like PHP does.