Skip to content
LovelyTools
EN

SQL Minifier

Compress SQL to a single line, removing comments but keeping string literals intact.

Processed locally on your device — nothing is uploaded.

About the SQL Minifier

Embedding a query in code, a config file or a log is easier when it fits on one line. This minifier removes -- and /* */ comments and collapses whitespace, while text inside quotes stays untouched so values do not change.

Use the SQL Formatter to expand a minified query again.

How to use the SQL Minifier

  1. Paste SQL.
  2. The minified version appears instantly.
  3. Copy it.

Features

  • Batch files: run the tool on up to 200 files with the same settings and download every result as one ZIP
  • Removes line and block comments
  • Protects string literals
  • Single-line output
  • Live result

Supported formats

  • Plain text

Frequently asked questions

Does it change the query results?

No. Only comments and insignificant whitespace are removed.

Is my text sent anywhere?

No. Everything runs in your browser, so nothing you paste is uploaded or stored.