Embedding a query
A multi-line query is collapsed to one line so it can be stored as a single config value without escaping newlines.
Converts sql to minified sql in this tab, with nothing sent anywhere.
Find related browser-local tools for nearby tasks without starting another search.
Browse all developer and data toolsA SQL minifier does the opposite of a formatter: it strips comments and collapses a multi-line query onto a single compact line. That is what you want when a query has to be embedded in a string, a config value, a log line or a URL parameter, where newlines and indentation are noise or break the surrounding format. This tool removes SQL comments and squeezes the whitespace in the browser, leaving a one-line query that means exactly the same thing. Because it runs on your device, a query carrying private schema detail is compacted without being uploaded anywhere. It is also handy for comparing two queries: once both are minified to a single canonical line, a diff shows only the parts that genuinely differ rather than every difference in indentation and comments. And for anyone pasting SQL into a JSON payload or a YAML value, a one-line query avoids the escaping that multi-line strings force in those formats.
A multi-line query is collapsed to one line so it can be stored as a single config value without escaping newlines.
A query is minified before being written to a log, keeping each entry on a single readable line.
A shorter query is harder to inspect and its length does not predict database performance. Keep the formatted source and compare quoted strings and statement boundaries after minification. Execution plans, indexes and row counts drive query cost; removing spaces does not optimize those operations.
No. Only comments and extra whitespace go; the query runs identically to its formatted version.
Yes. Whitespace inside quotes is preserved, so text values inside the query are not altered.
SQL Formatter in your browser. Instant, accurate, and nothing is uploaded.
Turn a JSON array into SQL INSERT statements in your browser, with quotes escaped correctly.
CSS Minifier in your browser. Instant, accurate, and nothing is uploaded.