WebToolsForAll

Tools / Text Tools

SQL standard string literal escaper

Build a standard single-quoted SQL string literal; use parameters in real queries.

Input

0 UTF-16 code units

Optional local draft

Saving stores a plaintext draft in this browser on this device. Do not save secrets or use this on a shared device. Nothing is saved or loaded automatically. Reset does not delete a saved draft; use Delete local draft.

No draft has been loaded.

Import a local text file

Output

Work through the task

Create one SQL-standard single-quoted text literal.

  1. Enter the text value, not an entire SQL statement or an identifier.
  2. The transformation doubles apostrophes and retains backslashes as literal characters. Use parameters with your database driver for real queries.
  3. Review the result before copying or downloading. Editing an input invalidates the previous result; keep an original if the transformation matters.

Example to check

O'Reilly → 'O''Reilly'.

Limits and output behavior

Maximum 100,000 input characters and 1,000,000 output characters. Contexts have different complete-literal rules; unsupported syntax and malformed encoded input are rejected. Escaping is not application validation, general HTML sanitization or SQL injection protection. A literal transformation does not implement a driver’s parameter binding or a database-specific statement parser.

Troubleshooting

Enter one text value rather than a statement/identifier, and check size and supported-character diagnostics. Review the complete quoted literal before copying.

Questions

Should I use this instead of database parameters?

No. Use the database driver’s parameter binding for actual queries. Doubling apostrophes is a literal transformation, not general SQL injection protection.

Input and privacy

Processing runs in this browser. Inputs are not saved automatically. An explicitly chosen local draft, where offered, is plaintext storage on this device. Downloaded files, clipboard contents and browser extensions have separate retention behavior.