SQL injection risk
Escaping alone is not a substitute for parametrised queries.
Fix: Use prepared statements whenever possible and treat this tool as a fallback.
header • up to 320x100 / 728x90
Escape or unescape SQL string literals using standard single-quote doubling
Output will appear here...
content bottom • up to 300x250
sidebar • 160x600
Last reviewed:
SQL (Structured Query Language) is the standard language for querying and managing relational databases such as PostgreSQL, MySQL, and SQL Server.
SQL Escape / Unescape prepares text for embedding in an SQL string literal by doubling single quotes ('') and escaping backslashes. The unescape direction collapses them back to a raw string.
It is useful when building ad-hoc queries, generating seed data, writing migration scripts, or decoding quoted literals out of an SQL dump.
O'Neil — "backup\"
O''Neil — "backup\\"
Escaping alone is not a substitute for parametrised queries.
Fix: Use prepared statements whenever possible and treat this tool as a fallback.
Some drivers also treat \ specially.
Fix: This tool doubles backslashes to stay compatible with both ANSI and MySQL behaviour.
No — ANSI SQL only requires single-quote doubling and backslash handling.
Not on its own. Use parametrised queries as the primary defence.
Backticks are identifier quotes — this tool is for string literals only.
Yes — encode as JSON first, then SQL-escape the resulting string.
No — processing runs entirely in your browser.
Pair SQL escape with JSON, HTML, and JS escape helpers for multi-layer encoding pipelines. You can also browse the full Encoders & Decoders category for more options.
Escape JSON special characters
Escape or unescape JavaScript string literals with backslash, quote, Unicode, and control-character handling
Escape or unescape XML special characters and numeric entities with one click
Round-trip Java string literals — escape quotes, backslashes, newlines, and Unicode sequences
Escape or unescape C# string literals including \x, \u, and \U Unicode escape sequences
Format SQL queries online with keyword case, indentation, and readable line breaks for cleaner MySQL, PostgreSQL, and SQL Server statements.
Escape SQL special characters
Wrap a raw string in a JSON string literal — perfect for embedding content in a JSON payload
Wrap an XML document in a JSON string literal for safe embedding in payloads
Encode or decode HTML entities
Encode text to HTML entities
Encode or decode JSON strings