SQL minifier
Compress an SQL script by stripping comments and extra whitespace.
Related tools
SQL minifier
Paste an SQL script and this tool strips the comments and collapses every run of whitespace, returning the most compact version that still runs. Typical jobs: embedding a query as a one-line string in application code, comparing a hand-written statement with what an ORM or a slow-query log actually produced, shrinking a long migration script before storing it, or squeezing a query into a URL parameter or a JSON field.
A small tokenizer walks the script character by character instead of applying blind find-and-replace, so string literals and quoted identifiers are never modified. Single-quoted strings with doubled '' escapes, double-quoted identifiers and MySQL backtick names pass through byte for byte, even when they contain -- or /* sequences that only look like comments. Comment removal covers -- line comments and /* */ blocks and can be switched off. Tight spacing additionally deletes spaces after an opening parenthesis, before a closing one and around commas. The layout option puts the whole script on one line or starts a new line after each top-level semicolon.
Two honest limits. This is the opposite of a formatter: it does not change keyword casing, re-indent or beautify anything — run the result through a formatter when you need readable SQL back. And # comments are deliberately left untouched, because removing them would destroy #temp table names in T-SQL scripts.
Minification runs entirely in your browser. Queries tend to expose table names, schema details and business logic, and none of that leaves your device — nothing is uploaded, logged or stored anywhere. The tally under the output shows bytes in and out, the percentage saved and the statement count.