SQL Minifier
Conservatively remove comments and redundant whitespace from SQL without executing it.
Minify SQL
Method
The minifier uses a lightweight character scanner that preserves single- and double-quoted strings, removes ordinary -- line comments and /* */ block comments, and collapses redundant whitespace.
Worked example
A SELECT statement containing comments and line breaks is reduced to one compact statement while quoted text remains intact.
Privacy
Pasted SQL stays in the browser and is never executed.
Limitations
This is not a dialect-complete SQL parser. Vendor-specific quoting, dollar-quoted strings, nested comments, procedural SQL, or malformed statements may require a specialized parser-based minifier.