TThe TextSolutions

Escape / Unescape Strings

Escape or unescape special characters in strings for JSON, JavaScript, SQL, HTML, and regular expressions.

Input
Output

Frequently Asked Questions

What does escaping a string mean?

Escaping adds backslashes or special sequences so that characters like quotes, newlines and backslashes can be safely included in code or data without breaking it. For example a quote inside a JSON string becomes \".

Which formats can this tool escape for?

It can escape and unescape strings for JSON, JavaScript, SQL, HTML and regular expressions, each of which has its own rules for which characters must be escaped.

When do I need to escape a string?

Escape whenever you embed text containing special characters into source code, a JSON value, a SQL query or HTML. This prevents syntax errors and helps protect against injection vulnerabilities.

Can it unescape text too?

Yes. Paste an already-escaped string and the tool reverses the process, turning sequences like \n and \" back into real newlines and quotes.