SQL String Literal Escaper
Double straight apostrophes inside a single-quoted SQL string; use bound parameters in applications.
Try a small example
Try a small example
Load the fictional example in a cleared form. Check the options, run the tool if needed, and compare the result below.
Double each straight apostrophe for insertion as the inner text of a single-quoted SQL string: O'Brien becomes O''Brien. Paste the literal text, for example O'Brien, then select Double apostrophes for SQL. The output O''Brien goes between the single quotes; this tool does not add the surrounding quotes. Use bound parameters for application queries. SQL escape rules vary by database, so this transformation is not a general SQL injection defense. The output contains only the inner text, not surrounding quotes. This minimal transformation is not portable across every database and configuration and does not guarantee protection from SQL injection. Use parameterized queries in applications.
Text inside a single-quoted SQL string
O'Brien
Expected output
O''Brien
The example is unavailable until the tool is ready.
Text is processed in your browser.
Share this tool
Only the tool’s public link is shared. Your inputs and results stay here.
Show link to copy manually
Quick answer
Double each straight apostrophe for insertion as the inner text of a single-quoted SQL string: O'Brien becomes O''Brien.
The page and its assets load from the site; this operation uses your entered values only in this browser and does not send them to a calculation endpoint.
How to use it
Paste the literal text, for example O'Brien, then select Double apostrophes for SQL. The output O''Brien goes between the single quotes; this tool does not add the surrounding quotes. Use bound parameters for application queries. SQL escape rules vary by database, so this transformation is not a general SQL injection defense.
Limits
The output contains only the inner text, not surrounding quotes. This minimal transformation is not portable across every database and configuration and does not guarantee protection from SQL injection. Use parameterized queries in applications.
Frequently asked questions
Does the tool add SQL quotation marks?
No. It doubles straight apostrophes only, so O'Brien becomes O''Brien. Add surrounding SQL quotes yourself only when you are deliberately writing a literal.
Are curly apostrophes changed?
No. The tool changes the straight apostrophe character used as the SQL quote delimiter; typographic apostrophes stay unchanged.
Can I use this to prevent SQL injection in an application?
No. Escaping varies by database and context, and this simple text transform cannot secure a query. Use parameterized queries instead.
Sources and references
These references document the cited standard or browser API; they do not validate the tool’s output.
