SQL Minifier
Collapses a SQL query onto one line and removes comments, so it can be embedded in a config file, a log line, or a shell command. Text inside string literals and quoted identifiers is preserved exactly, and spacing is only kept where removing it would change the query. Runs entirely in your browser — nothing is sent to a server.
Collapses a SQL query onto one line and removes comments, so it can be embedded in a config file, a log line, or a shell command. Text inside string literals and quoted identifiers is preserved exactly, and spacing is only kept where removing it would change the query. Runs entirely in your browser — nothing is sent to a server.
Use cases
- Embedding a query in a JSON or YAML config value
- Pasting a multi-line query into a single-line prompt
Examples
Multi-line query
SELECT id, name FROM users WHERE active = 1;
SELECT id,name FROM users WHERE active=1;
FAQ
Is my query sent to a server?
No — this tool runs entirely in your browser.
Are comments removed?
Yes. A line comment would otherwise swallow the rest of the query once it is on a single line.
Is anything inside my strings changed?
No. String literals and quoted identifiers are copied verbatim.