Compact a formatted SQL statement into a single tidy line by removing comments and collapsing extra whitespace. Minified SQL is convenient when you need to embed a query in a config value, drop it into a log line, paste it into a single input field, or share it compactly in a message without losing any meaning. This tool strips single line comments that start with two dashes and block comments, then squeezes runs of spaces, tabs and newlines down to single spaces, while preserving the contents of quoted strings and identifiers so your data and column names stay intact. Paste your SQL, click minify, and copy the compact query. Everything is processed locally in your browser, so schema details and query logic never leave your machine.
It collapses a multi-line query into a single compact line by stripping comments and extra whitespace, which is handy for logs or embedding in code.
No. Only formatting is removed. The statement runs exactly the same, just on one line.
Yes. Whitespace inside quoted string literals is kept, so only the surrounding formatting is compacted.
Compact a formatted SQL statement into a single tidy line by removing comments and collapsing extra whitespace. Minified SQL is convenient when you need to embed a query in a config value, drop it into a log line, paste it into a single input field, or share it compactly in a message without losing any meaning.
Yes. SQL Minifier is completely free, with no sign-up and no usage limits.
Yes. SQL Minifier runs in any modern web browser. There is nothing to download or install.
Yes. SQL Minifier runs entirely on your device in your browser, so nothing you enter is uploaded to a server.
Link this tool from a README, doc or site. The badge links back to this page.
[](https://yourhack.ai/sql-minifier)