All Tools › SQL Minifier

SQL Minifier

Compress SQL onto a single line by removing comments and extra spaces.

Collapse SQL to a single line

Sometimes you need a query as one compact line — to embed it in code, paste it into a tool that expects a single statement, or store it without the formatting. Minifying strips the extra whitespace and line breaks while leaving the query's meaning unchanged. This tool turns a nicely formatted query back into a tight one-liner.

How to use it

  1. Paste your formatted SQL.
  2. Minify it to a single line.
  3. Copy the compact query.

When it helps

Questions people ask

Will it break string literals that contain spaces? Spacing inside quoted strings is preserved; only the structural whitespace around the query is collapsed.

Is my query uploaded? No — minifying runs in your browser.