Free · Private · In-Browser

SQL Minifier

Collapse SQL snippets into compact one-line queries.

Output
 

Collapse SQL to one line

Sometimes you need a query on a single line — to embed in code, a config value, or a log line. This minifier collapses a formatted SQL snippet into a compact one-liner, stripping the comments and extra whitespace that get in the way.

It is the counterpart to formatting: format while you write and debug, minify when you need a tight string. Paste your query, get the collapsed version, and copy it where a single line is required.

One-line SQL, locally

It collapses a formatted query to a single line for embedding in code or a config value. Minifying runs in your browser and never uploads anything.

Frequently asked questions

What does the SQL minifier remove?

Comments, both -- line comments and /* block */ comments, plus extra whitespace, leaving a one-line query.

Can it change a query that has -- inside a string?

Yes. Text after -- is treated as a comment even inside quotes, so check queries that contain -- in string values.

Why minify SQL?

One-line queries are easier to embed in code, logs, and config files.

Take it further
Developer Tools

Practical utilities for everyday web development work.

Learn more