Compress SQL queries by removing whitespace
SQL minification is the process of removing unnecessary characters from SQL queries without changing their functionality. This includes removing extra whitespace, line breaks, and optionally comments. The result is a compact query that takes up less space, which is useful for reducing network traffic, embedding SQL in applications, or optimizing stored procedures.
This tool minifies SQL queries by collapsing multiple spaces, removing newlines, and optionally stripping comments. The output is a single‑line (or compact) version of your query that executes exactly the same as the original.
All processing is done locally in your browser – your queries never leave your device.
Step 1: Paste your SQL query into the input area.
Step 2: Choose options: remove comments, collapse spaces (default).
Step 3: Click "Minify SQL" to compress the query.
Step 4: Copy the minified output using the "Copy Minified" button.
Minified SQL is especially useful for embedding in application code, reducing log file size, or when sharing queries in space‑constrained environments.
Input (formatted):
SELECT
name,
age
FROM users
WHERE active = 1
Minified:SELECT name, age FROM users WHERE active = 1