https://devtools.solutions/tools/sql/sql-minify.html

Minify SQL

Remove all unnecessary whitespace and comments from SQL to produce a compact single-line query.


    

Frequently Asked Questions

Does this execute SQL?

No. This page only reformats text and does not run queries.

Can I minify SQL for embedding?

Yes. Use Minify SQL to collapse whitespace into a compact query string.

Is minification done server-side?

No. SQL transformations run client-side in your browser.

Example input/output

Input:

SELECT
  id,
  name
FROM users
WHERE active = 1

Output: SELECT id,name FROM users WHERE active=1

How it works

This tool strips SQL comments (-- line and /* block */ style), collapses whitespace sequences to single spaces, and trims the result. Processing runs in your browser.

Common use cases

Related tools