Advertisement
SQL Minifier Online – Compress SQL Queries Free
Minify SQL by removing comments and collapsing whitespace into a single compact line. Supports all SQL dialects. Instant results — all client-side.
SQL Minifier
Ready to minify
Paste your SQL query on the left and the result will appear here instantly
What is SQL Minifier?
Compress SQL queries by stripping -- and /* */ comments and collapsing all whitespace into a single line. Optionally normalise SQL keywords to uppercase. Great for embedding queries in application strings, reducing stored procedure size, or cleaning up generated SQL. Instant, 100% browser-based.
SQL Minifier Features
Comment Removal
Strip both -- line comments and /* */ block comments from any SQL query.
Keyword Normalisation
Optionally uppercase all SQL keywords (SELECT, FROM, WHERE, JOIN…) for consistent style.
All Dialects Supported
Works with MySQL, PostgreSQL, SQLite, SQL Server, Oracle, and any standard SQL.
Advertisement
SQL Minifier FAQ
Yes — SQL parsers ignore whitespace. A single-line query runs identically to a multi-line formatted one.
The minifier works on all standard SQL dialects including MySQL, PostgreSQL, SQLite, SQL Server, and Oracle.
Common reasons include embedding queries in code strings, reducing the size of migration files, and cleaning up dynamically generated SQL before logging.
No — the tool is a text-level minifier, not a parser. For validation, run the query against your database or use a dedicated SQL linter.