Search tools

Search for a command to run...

String Escape / Unescape

Escape or unescape strings for JavaScript, JSON, HTML, XML, SQL, CSV and regular expressions — quotes, backslashes and newlines handled.

How to use

  1. 1Pick the language and whether to escape or unescape.
  2. 2Paste the string and copy the result.

Frequently asked questions

Why escape strings?

Quotes, backslashes and newlines have special meaning inside string literals. Escaping lets them appear as ordinary characters.

How are quotes escaped in SQL?

A single quote is doubled: O'Brien becomes O''Brien. Prefer parameterized queries over manual escaping in real code.

What does regex escaping do?

It puts a backslash before characters like . * + ? ( ) [ ] so they match literally instead of acting as operators.