Skip to content
Devtoolry

SQL Minifier

Compress SQL queries onto a single line, removing comments and redundant whitespace.

About the SQL Minifier

The SQL Minifier compresses queries onto a single line by removing comments and extra whitespace, which is handy for logs, environment variables and code that embeds SQL strings.

Everything runs in your browser, so your input is never uploaded to a server.

How to use the SQL Minifier

  1. Paste SQL.
  2. Review the single-line result.
  3. Copy it into your code or configuration.

Frequently asked questions

Are string literals changed?

No. Whitespace inside quoted strings is kept exactly as written.

Are comments removed?

Yes, both -- line comments and /* block */ comments are removed.