Escaping runs entirely in your browser — nothing is uploaded.
Escape and unescape SQL string literals online, free. SQL string escaping makes text safe to embed in a single-quoted SQL literal by doubling any apostrophe — the ANSI-standard rule that works in MySQL, PostgreSQL, SQLite, SQL Server and Oracle. This tool wraps your text in quotes and doubles inner apostrophes, or reverses it, entirely in your browser. It is for building ad-hoc literals — not a substitute for parameterized queries.
It uses portable ANSI quote-doubling ('' for a literal apostrophe), which every major SQL engine understands. 100% free, no registration, and complete privacy — everything runs locally in your browser, so your data never touches a server.
Doubles each ' to '' and wraps the value in single quotes — the portable standard across SQL engines.
Build a safe literal from raw text, or strip quoting from an existing literal.
Runs locally with no upload — safe for production values.
Your queries, table names and seed values never leave your device.
Double it. A literal apostrophe inside a SQL string is written as two single quotes — 'it''s' represents the value it's. This is the ANSI SQL standard and works in MySQL, PostgreSQL, SQLite, SQL Server and Oracle. This tool wraps your text in single quotes and doubles any apostrophe automatically.
No. Escaping helps you build a valid string literal, but the robust defence against SQL injection is parameterized queries / prepared statements, which separate code from data entirely. Use this tool for ad-hoc scripts, migrations and seed data — not as your application's primary input handling.
The portable rule — doubling single quotes — works in both. MySQL also accepts backslash escapes (\') by default, while PostgreSQL treats backslashes literally unless you use an E'' string. To stay portable, this tool uses standard quote-doubling, which every major engine understands.
No. All escaping and unescaping runs locally in your browser. Your queries, table names and seed values never leave your device — safe for production data.
Paste the quoted literal (e.g. 'it''s') and click Unescape. The tool strips the surrounding quotes and collapses each doubled '' back to a single apostrophe, returning the original value.
We use cookies for analytics and personalized ads to help keep these tools free. Until you accept, ads stay non-personalized and analytics cookies are off. See our Privacy Policy.