SQL Minifier
Collapse whitespace in SQL to remove blank lines and padding, keeping string literals intact so the query still runs exactly the same way as before.
How to use
- Paste a query into the input.
- Turn on stripping comments to remove inline notes.
- Copy the single-line query.
An SQL minifier collapses whitespace between tokens and removes optional comments, producing a single-line query. Quoted strings and identifiers are tokenised first so their contents stay intact.
Paste or type something above.
Questions about sql minifier
- Is a single-line query still valid?
- Yes. SQL does not need newlines. Only comments and the final semicolon are removed.
- Will comments inside strings be removed?
- No. Anything inside single quotes, double quotes, or backticks is copied through unchanged.
- Should I run the minified query?
- Yes, it is the same query. Keep a readable copy for review, since minified SQL is harder to debug.
Related tools
- SQL Formatter Re-indent SQL queries so major clauses start on their own line, uppercasing keywords while...
- JSON Minifier Remove every space, newline, and indent from JSON to shrink the payload size, ready to pas...
- CSS Minifier Remove comments and redundant whitespace from CSS to shrink the file, keeping strings and...