Free SQL escape & unescape tool — single-quote doubling for MySQL, PostgreSQL, SQLite

Escaping runs entirely in your browser — nothing is uploaded.

🗄️ SQL Escape / Unescape — Free Online Tool

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.

🚀 Why use this SQL Escape / Unescape tool?

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.

Key Features

🧱ANSI quote-doubling

Doubles each ' to '' and wraps the value in single quotes — the portable standard across SQL engines.

🔁Escape & unescape

Build a safe literal from raw text, or strip quoting from an existing literal.

Instant & in-browser

Runs locally with no upload — safe for production values.

🔒100% private

Your queries, table names and seed values never leave your device.

Popular Use Cases

Scripts & migrations

  • Build INSERT seed data
  • Embed text with apostrophes
  • One-off admin queries

Debugging

  • Decode a quoted literal
  • Inspect doubled quotes
  • Fix a broken string literal

Learning

  • Understand quote-doubling
  • Compare engine behaviours
  • See ANSI vs backslash escapes

What It Handles

Modes

  • Escape (text → literal)
  • Unescape (literal → text)

Handles

  • Single quotes (→ '')
  • Wrapping quotes
  • Portable ANSI form

Privacy

  • Client-side only
  • No network calls
  • Runs offline

Sources & References

Frequently Asked Questions

How do you escape a single quote in SQL?

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.

Is SQL escaping a safe substitute for parameterized queries?

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.

Do MySQL and PostgreSQL escape strings differently?

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.

Does the tool upload my SQL anywhere?

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.

How do I unescape a SQL string literal?

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.

🎓 Pro Tips

  • Tip 1: Use this for scripts and seed data only — in application code, always use parameterized queries to prevent SQL injection.
  • Tip 2: Quote-doubling ('') is portable across engines; avoid backslash escapes if your SQL must run on PostgreSQL.
  • Tip 3: Round-trip to verify: escape a value, then unescape it, and confirm it matches the original.