SQL Minifier

Squeeze a query onto one line for code, logs or config files without breaking it.

How to minify SQL

  1. Paste SQL or open a .sql file.
  2. Choose what to remove and the keyword case.
  3. Copy or download the minified SQL.

About SQL Minifier

Compress SQL into a compact query.

Everything works in your browser, so it is instant and private, and your settings are remembered on this device.

Good for

  • Embedding queries in source code and JSON
  • Shrinking SQL in logs and configs
  • Sending queries through APIs

Tip: Keep “One statement per line” on for migration files so each statement stays easy to find.

Frequently asked questions

Will it break my strings?

No — text inside quotes, backticks, [brackets] and PostgreSQL $$ blocks is kept exactly as written, including spaces and anything that looks like a comment.

Are optimizer hints kept?

Yes — /*+ … */ hints and MySQL /*! … */ comments are kept unless you turn that off.

Why minify SQL?

To embed queries in code, JSON or config files on one line, to shrink logs, or to make queries harder to read casually.

Can I get it readable again?

Yes — paste it into the SQL Formatter.

Is my data uploaded?

No. Everything is processed by JavaScript in your browser — nothing you paste or open is sent to a server, so it is safe for API responses, tokens, configs and customer data. It also works offline once the page has loaded.

Related tools

← Back to all tools