SQLFormatter
FormatterConvertPricingDocsGet Pro
Tool · Minify

SQL minifier

Compress SQL onto a single line: comments are stripped and every run of whitespace collapses to one space, while the contents of string and quoted-identifier literals are left untouched. Useful for embedding a query in a config value, a log line or a one-line shell command. It all happens in your browser — nothing is uploaded.

SQL minifier32% smaller
input
minified
SELECT u.id, u.email FROM users u WHERE u.active = true ORDER BY u.created_at DESC;

Minify vs. beautify

Minifying and beautifying are opposites: the minifier crushes a query to one line for machines, the formatter expands it back into indented, readable SQL for humans. Round-tripping is safe — minify to embed, then paste into the formatter to read it again.

More SQL tools

Explain a SQL queryOptimize a SQL queryConvert between dialectsSQL validator