SQL Minifier
Squeeze a query to one line without changing what it does.
Works in your browser. Your SQL is never sent to us or run.
Formatted in your browser. Your SQL is never sent to us or run against any database.
SQL Minifier at a glance
- Price
- Free
- Data sent to us
- None, it runs in your browser
- Sign-up
- Not needed
- Dialects
- 13, including MySQL, PostgreSQL, SQL Server, Oracle, SQLite, BigQuery
- Modes
- Formatted, minified
- Runs queries
- Never
How to use SQL Minifier
- Paste your SQLPut the query in the left box. The formatted version appears on the right.
- Pick the dialect and styleChoose your database, keyword case, indent and layout.
- Copy or downloadCopy the result, switch to Minified for one line, or download a .sql file.
Paste a formatted query or script and get it on one line, with -- and /* */ comments, line breaks and extra spaces removed, for a config file, an environment variable, a log message or a test fixture. Text inside quotes, quoted names and bracketed identifiers are kept exactly as they were.
How it works
SQL Minifier is a web page that does its work on your own device. Everything you type or choose is worked out by your browser and never sent to a server, so nothing is stored and there is nothing to delete. There is no account, no sign-up and no limit on how often you use it.
Back to readable
Switch to Formatted on the same page to lay the query out again.
Questions
Are comments removed?
Yes, both -- line comments and /* block */ comments. Hints written as comments in some databases are removed too, so keep those queries formatted.


