Compact SQL while preserving strings

Web developers use SQL Minifier when preparing compact code for delivery or a controlled comparison.

Compact SQL while preserving strings and get compact code ready for the next step. Use it for free in your browser, with no account required.

How to use

  1. Paste the SQL query you want to compact into the input area, or import the file that holds it.
  2. Run the minification so spare spaces, line breaks and comments are removed.
  3. Check that string literals and values in the result are still exactly as you wrote them.
  4. Copy the compact version to ship it or to compare it with another revision.

Example

You are about to place a short query inside a deployment script, and the minified version fits on a single line without breaking the strings. Compare it against the original afterwards to make sure no condition disappeared along the way.

Limits and formats

Where processing happens

Minification runs locally in your browser: the query you paste or import stays on your device and is not sent anywhere. Nothing is stored, and you can use the tool repeatedly without creating an account.

Frequently asked questions

Are comments removed during minification?

Yes, comments are treated as unnecessary for execution and are dropped. If a comment explains an important decision, move it into your documentation before you compact the query.

Can I minify a file with several statements?

You can import it, but the output becomes one very long line. Splitting the file into separate statements first makes the result far easier to check.

Will minifying make my query run faster?

The main effect is a smaller file to store or transfer, not a faster database engine. Do not expect minification to fix slow queries caused by missing indexes or heavy joins.

Tools in the same category