Minify multi-line SQL queries for production logs, environment strings, or embedded database queries. Strips line and block comments while safely preserving string literals.
Runs entirely in your browser
The counterpart to formatting: this tool compresses a multi-line SQL query onto a single line, stripping comments and superfluous whitespace. That is what you want when a query has to live in a log line, an environment variable, or an embedded string in code where a compact form is cleaner.
It does this safely — string literals are preserved intact, so text inside quotes (which might contain spaces or comment-like characters) is not damaged, and both line and block comments are removed. The result is a functionally identical query in the smallest sensible form.
It runs in your browser, so your queries are not uploaded. Use it to inline a query, shrink one for a config value, or clean comments out of SQL before embedding it.
TechToolsHQ is an independent, reader-supported tech platform. If this free tool saved you time, solved a problem, or helped your workflow, consider supporting our work. Your support helps us keep our utilities 100% free, private, and ad-free for everyone.