Minify SQL Online — Free SQL Compressor

Minify SQL queries with our free online tool. Select, reorder, concatenate and minify multiple .sql files as one bundle with your current options. FastMinify preserves string literals while everything stays in your browser.

Loading…
SQL Minification
Minify SQL online.

Features

Compress queries by stripping whitespace. This is not a full parser.

Minify SQL

Compress queries by stripping whitespace. This is not a full parser.

Basic example

Input SQL

-- Active customers with recent orders SELECT c.id, c.email, o.total, o.created_at FROM customers AS c INNER JOIN orders AS o ON o.customer_id = c.id WHERE c.active = TRUE AND o.status = 'completed' ORDER BY o.created_at DESC LIMIT 50;

Minified SQL

SELECT c.id, c.email, o.total, o.created_at FROM customers AS c INNER JOIN orders AS o ON o.customer_id = c.id WHERE c.active = TRUE AND o.status = 'completed' ORDER BY o.created_at DESC LIMIT 50;

Options

Remove Comments
Strip -- line and /* block */ comments during minify (outside string literals).

Comments outside literals are removed

Concatenating SQL Files

On Minify SQL, select or drop multiple .sql files, reorder them, then concatenate and minify the complete bundle once with your current options. Processing stays in your browser. Optional file markers, comments and extra spacing are added before minification and may be removed from the final output when removeComments is enabled. Toolbar dialect settings apply to beautify pages only. Minify concat collapses whitespace and comments on the whole bundle.

FAQ about minifying SQL

Minification

Why minify SQL?

Smaller query scripts for logs, embeds and deploy bundles.

Need to beautify?

Use our SQL beautifier.

Need to unminify?

Try the SQL unminifier.

How do I concatenate and minify multiple SQL files?

On Minify SQL, use the concat button or drop two or more .sql files on the input panel. Reorder them, then concatenate and minify the complete bundle once with your current options. Everything runs in your browser. This workflow is not available on Beautify SQL or Unminify SQL. File markers or extra spacing may be removed during minification when removeComments is enabled.

Verify it yourself

FastMinify processes your input in the browser. Inspect the network panel or read our validation gate to confirm nothing leaves your device.

Minify JavaScript, CSS, HTML, JSON, XML, SVG and other formats to cut the bytes you ship, before gzip or a CDN.