SQL Minifier
Paste a SQL query to instantly strip comments and excess whitespace, producing a compact single-line output.
Original SQL
0 chars
Options
Minified SQL
0 chars
Compression Stats
—
Original
—
Minified
—
Saved
Size reduction
0%
Copied!
Summary
Paste a SQL query to instantly strip comments and excess whitespace, producing a compact single-line output.
How it works
- Paste your SQL query into the input box.
- The minifier removes /* block comments */ and -- single-line comments.
- All newlines, tabs, and consecutive spaces are collapsed into one space.
- The result is trimmed and displayed in the output box.
- Click "Copy Minified SQL" to copy it to your clipboard.
Use cases
- Embed compact SQL in application config files or environment variables.
- Reduce query string length when logging or tracing SQL statements.
- Quickly strip development comments before pasting into production scripts.
- Compare minified length vs. original to see how much whitespace was added.
- Prepare SQL strings for inclusion in source code string literals.
- Clean up auto-generated SQL before sharing with teammates.
Frequently Asked Questions
Related tools
Last updated: 2026-05-29 ·
Reviewed by Nham Vu