SQL String Escape / Unescape

Escape or unescape strings for SQL queries. Supports MySQL and PostgreSQL modes.

Processed on your device β€” never uploaded
Input
Output

Frequently Asked Questions

Why do I need to escape SQL strings?
Escaping prevents SQL injection attacks by neutralizing special characters like single quotes that could break your query or allow malicious code execution.
What characters need escaping in SQL?
Single quotes ('), backslashes (\), and null bytes are the most common characters requiring escaping. MySQL also escapes double quotes and percent signs.
What is the difference between MySQL and PostgreSQL escaping?
MySQL uses backslash escaping (\') while PostgreSQL uses double single quotes (''). This tool supports both modes.