130 of 149 tools live Roadmap LatestImage to Text

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

Takes about 1 minute. You need a SQL query or script.

  1. Paste your SQLPut the query in the left box. The formatted version appears on the right.
  2. Pick the dialect and styleChoose your database, keyword case, indent and layout.
  3. Copy or downloadCopy the result, switch to Minified for one line, or download a .sql file.
SQL Formatter: Turn a one-line query into readable SQL, or squeeze it back to one line.

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.

Other shortcuts

More

Privacy policy · Support · Changelog

Suggest a tool

Tell us what the tool should do. If we build it, we will let you know.

Used only to reply to you. See our Privacy Policy.