Administration and development

Escape and unescape

Escape or unescape text for JSON, JavaScript, regular expressions, shell, SQL, CSV and XML.

What does this mean?

Some characters have a special meaning in code, such as quotes, backslashes and line breaks. Escape converts them so your text fits safely in JSON, JavaScript, a regular expression, a shell command, SQL or CSV. Unescape reverses that.

For Base64, URL encoding and HTML characters there is Encode and decode. For SQL this only doubles single quotes; in your own code prefer prepared statements.