$ toolfu run sql-minifier
SQL Minifier — Minify SQL Queries Online Free
Free online SQL minifier. Remove comments, collapse whitespace, and strip unnecessary spaces from SQL queries. See size reduction stats.
all processing runs in your browser
sql-minifier
input > SQL
original: 290 Bminified: 220 B−24%
minified output
Minify SQL Queries Instantly
Large SQL queries with comments and formatting are great for readability during development. But when you need to embed them in application code, transmit them over a network, or store them in a config file, the extra whitespace and comments are just overhead.
This tool strips single-line (--) and multi-line (/* */) comments, collapses whitespace, and removes unnecessary spaces around operators. You get a compact, functionally identical query with size comparison stats.
What gets removed
- Single-line comments (-- ...)
- Multi-line comments (/* ... */)
- Extra whitespace, newlines, and tabs
- Unnecessary spaces around operators and punctuation
$ cat FAQ.md
What does SQL minification do?▶
SQL minification removes comments (both -- single-line and /* multi-line */), collapses whitespace, and strips unnecessary spaces around operators. The resulting query is functionally identical but takes fewer bytes.
Will minification break my SQL?▶
The minifier only removes whitespace and comments — it doesn't alter SQL keywords, identifiers, or string literals. However, always test minified queries in a safe environment first, especially if they contain edge cases like strings with special characters.
When would I need minified SQL?▶
Minified SQL is useful when embedding queries in application code, reducing payload size for network transmission, or storing queries in configuration files where readability isn't needed.
Is my SQL sent to a server?▶
No. All processing happens in your browser. Your SQL queries never leave your device.