SQL MINIFIER
Strip comments and extra whitespace from SQL for compact, copy-ready queries. Strings stay intact and nothing is uploaded.
Original
172 B
Minified
110 B
Saved
36.0%
Text inside quotes ('strings', "identifiers", `backticks`) is never altered. Comments are removed and whitespace collapsed; the query itself is not parsed or validated.
How to minify SQL
- 1
Paste your SQL query or script into the input box.
- 2
The minified version appears instantly, with comments removed and whitespace collapsed. Toggle whether MySQL /*! ... */ conditional comments are kept.
- 3
Check the byte savings, then click Copy to use the compact SQL in your code or config.
Questions
- Will minifying change what my query does?
- No. Only comments and insignificant whitespace are removed. Text inside single-quoted strings, double-quoted identifiers, and backtick identifiers is preserved exactly, including repeated spaces and newlines.
- Which SQL dialects does it support?
- It works at the character level, so it suits MySQL, PostgreSQL, SQL Server, SQLite, and Oracle. It understands -- line comments, /* block */ comments, and doubled-quote escapes. MySQL # comments are not treated as comments because # is an operator in PostgreSQL.
- What are /*! ... */ comments and why keep them?
- In MySQL and MariaDB, /*! ... */ is a conditional comment that the server actually executes, often used in dumps for version-specific syntax or optimizer hints. They are kept by default; untick the option to strip them as ordinary comments.
- Is my SQL sent anywhere?
- No. Minification happens in your browser with plain JavaScript, so queries containing table names or data never leave your device.