SQL Minifier: Remove Comments and Compact SQL Online
SQL Minifier removes line and block comments and collapses extra whitespace to create compact SQL. It leaves string literals, quoted identifiers, and dollar-quoted blocks unchanged, and preserves MySQL hint blocks (/*! ... */) by default. After minification, it reports the size savings and checks that all significant tokens survive. Paste or drop SQL, select options, then copy the result.
SQL Minifier is a browser-based tool for making SQL more compact by removing comments and collapsing extra whitespace. It helps developers and DevOps engineers prepare SQL for delivery in a shorter text form while keeping important content intact. Paste or drop SQL, choose the available minification options, and review the result before copying it.
The minifier removes line and block comments and collapses extra whitespace. String literals, quoted identifiers, and dollar-quoted blocks are never modified. MySQL hint blocks (/*! ... */) are preserved by default. After processing, the tool reports the size savings and verifies that all significant tokens survive minification.
SQL and minified SQL use the same underlying SQL syntax; minification changes the text by removing comments and unnecessary whitespace rather than translating it into another language. This can be useful when you need a compact SQL payload for a URL, header, or configuration value, or want to compare the size before and after. The result is designed to keep significant tokens intact, with protected SQL content left unchanged.
SQL Minifier runs entirely in your browser, so your input is processed on your device and is not sent to a server. Once the page has loaded, it works offline without a server dependency. It is useful for developers and DevOps engineers who want to compact SQL, inspect size savings, and check token preservation without uploading their input.
Step 1: Paste or drop your SQL into the input area. The tool accepts SQL text and processes it in your browser.
Step 2: Choose the available minification options. MySQL hint blocks (/*! ... */) are preserved by default.
Step 3: Review the compact SQL result. Line and block comments are removed, and extra whitespace is collapsed while protected content remains unchanged.
Step 4: Check the reported size savings and token verification, then copy the result for your project.
Use case: Shrink SQL before shipping it in an application or deployment. Removing comments and extra whitespace creates a more compact version while preserving significant tokens.
Use case: Compare the original and minified size to decide whether compacting your SQL is worthwhile.
Use case: Create a compact SQL payload for a URL, header, or configuration value.
Use case: Prepare SQL snippets for use in scripts or other places where a shorter text representation is useful.
Use case: Remove line and block comments when you need a compact copy of a query while keeping string literals and quoted identifiers unchanged.
Use case: Check that significant tokens survive minification before using the compact SQL in your workflow.