Minify a SQL query

Remove comments and collapse the spaces and line breaks in a SQL query so it's easier to embed in a code string or a log.

Example:

How it works

The tool removes line comments (-- ...) and block comments (/* ... */), then reduces every run of spaces and line breaks to a single space. This is useful for pasting a compact query into a configuration file, an application log or an environment variable without breaking the formatting.

Does minification change the behavior of my query?

No, only comments and extra whitespace are removed; the SQL logic (keywords, tables, conditions) stays strictly identical. Quoted strings are preserved as they are.

Can I minify a query with multiple statements?

Yes, the tool processes all of the pasted text, whether it contains one or several statements separated by semicolons.

100% local processing: minification runs entirely in your browser via WebAssembly — your query is never sent to a server.