Make a query readable
Each clause (SELECT, FROM, WHERE, GROUP BY…) gets its own line with indented content, one column per line. Joins, AND and OR conditions, subqueries and CASE blocks are shifted according to their level. Keywords switch to upper or lower case, as you choose.
Choose the database
Writing differs from one system to another: MySQL backticks and # comments, PostgreSQL $$ strings and :: operator, SQL Server square brackets. Pick the right setting so these passages are read correctly.
Some traps reported
- Unclosed string, comment, name or bracket, CASE without END, extra comma, with line and column.
- UPDATE or DELETE without WHERE, which would change the whole table.
- The comparison “= NULL”, which never matches anything.
What the tool does not do
It runs no query and does not know your tables: a well-presented query may still be rejected by the database. Long stored procedures are formatted in a simple way. Minification removes comments, except the /*! and /*+ instructions.
Frequently asked questions
My query holds sensitive data: is it sent?
No. Formatting happens in your browser; nothing is transmitted or saved. Only your settings are kept on your device.
Can formatting change the result?
Only blanks and, if you ask, the case of keywords change. Strings, quoted names and numbers are copied identically.
Will my column names switch to upper case?
No, unless a column is named like a keyword without being quoted or prefixed by its table name. Choose “As written” if in doubt.
Why minify SQL?
To paste a query on a single line into a source file, a log or a command line.