← All Tools

SQL Escape🔒 100% local

Escape/unescape SQL strings for Postgres, MySQL, SQLite, SQL Server. Shows prepared-statement placeholders — the safe way.

SQL Escape: related tools

SQL Query FormatterSQL MinifierRegex Builder

Takes text and shows four ways to make it safe inside a SQL statement: standard single-quote doubling, a PostgreSQL dollar-quoted wrapper, a MySQL backslash escape, and a suggested parameterised form. It handles both escaping and reading back, so a value you paste comes out ready to drop into a query. The text is processed in the browser with no network call.

SQL Escape: how to use it

  1. Paste the value or SQL fragment into the input box.
  2. Press Process. Four labelled sections appear: standard, PostgreSQL dollar-quoting, MySQL backslash, and a prepared-statement example.
  3. Copy the section that matches your database, or Clear to start over.

SQL Escape: worked example

O'Reillybecomes=== Single-quote escape (standard SQL) === 'O''Reilly' === PostgreSQL dollar-quoting === $tagjjjw7a$O'Reilly$tagjjjw7a$ === MySQL backslash escape (SET NO_BACKSLASH_ESCAPES=OFF) === 'O\'Reilly' === Prepared statement (recommended - prevents injection) === 'O'?' === Tips === - ALWAYS use prepared/parameterized statements in application code. - This tool is for ad-hoc scripts / manual queries / debugging only. - For Postgres: use $tag$...$tag$ to avoid any quote escaping. - For MySQL/MariaDB: backslash escapes are ON by default - use doubling if server has NO_BACKSLASH_ESCAPES.

Computed in Node. The dollar-quote tag is generated at random on each run, so the tag shown here will differ; the escape characters in the MySQL line (backslashes) are exactly what the tool prints.

it's a 100% matchbecomes'it''s a 100% match'

The standard section alone, showing that the single quote is doubled and other characters are untouched.

SQL Escape: when to use it

SQL Escape: what it does not do